This isn’t a fern but the narrow, compound leaves can give it that appearance. Unlike ferns, the plant stems end in fine tendrils.
This is a weed called Vetch and is of the legume (Leguminosae) or bean/pea family. The purple flowers, held in round or long clusters show the distinctive bean/pea flower shape, which mature into small brownish seedpods containing 3 to 8 seeds. There are many species, most introduced from Europe, such as Tufted Vetch (Viccia cracca), and some natives such as Purple Vetch (Viccia americana). Vetch is a fodder and cover crop, and for the last several decades has been used in verges and highway green spaces as a ground cover to combat soil erosion. It can also be found growning abundantly in fruit tree orchards and cultivated fields. The flowers provide ample pollen for foraging bees throughout the summer. Being of the legume family, it is used as a cover crop in order to fix nitrogen into the soil, thereby letting the next crop use the now ample nitrogen in the soil. Vetch shows up in gardens from various sources but mostly it is spread by birds.
These plants grow rapidly in thin lawn turf or open areas with ample moisture as the plants are spread by either seed or rhizomes. Maintaining a thick lawn, so the vetch is starved out and seeds don’t have soil space in which to germinate, is one method of control. Aerating, overseeding and feeding is vital in maintaining vigor in a healthy lawn. Mowing before the vetch produces flowers will also prevent further spread of seeds. Pulling out the remaining stems and any rhizomes in the soil should deplete the established mature plant population.
In garden flower beds, on open soil, cutting the plants back before flowering will stop seed spread and hoeing out mature plants as the new growth comes in, will slow growth and weaken the plants. Then, laying a dense mulch of shredded bark will restrict new growth. Eventually, as your own planted garden matures in the beds, it will shade the soil and starve any weeds of light. If you see new plant growth along a fenceline or in an area where birds congregate, just pull them out to prevent re-seeding. Eventually, this weed can be controlled but vigilance is key.