There's no link between the two anymore. Baptism no longer requires either the child or their parents to be religious or church goers. A committed atheist who has never set foot in a church before can now be baptised. Whilst church attendance itself is declining, baptism rates are stable due to the upper-middle class and the Instagrammers getting their kids or themselves baptised due to it being a cool and wacky thing to do. It's slowly transitioning from being a religious ceremony to instead becoming something that is done to increase Insta likes or to mark a passage in growing up (plus it generates revenue for the church).
I'd had the impression that for many decades back from now, infant baptism (chiefly C of E) had been -- principally, maybe, among the "middle classes and above" -- for very many, "the done thing", but with effectively no serious-religious-belief-and-living content. A thing which has always sat badly with me personally -- feeling that it's hypocritical, and devaluing-and-demeaning all round: if those concerned are not serious Christians, let them not mess around, play-acting vis-a-vis this stuff -- if taken literally, signing the poor kid up to a potentially harsh and burdensome regime of living, to which it might well come not to want to be subjected. (Instagrammers finding the thing cool and wacky, is a new one on me -- but one feels that there's no limit to the bonkers stuff which humans can come up with.)
By the way, my non-believing parents -- most of a lifetime ago -- chose not to have me and my siblings christened; of which I am, for me, glad. I recall reading a good many years back, in someone's memoir: of -- on the way to a christening ceremony -- the memoirist's expressing to his companion, thoughts about the matter which were broadly in line with mine, above. The companion -- a politician of a rather smug and pompous stamp -- responded loftily, re the christening thing being about social bonding and "the grammar of living" (awful, condescending expression); with, I felt, the unspoken implication that the memoirist must be naive and / or some kind of head-in-the-clouds hippie outlier from society, for airing the views that he did. If I had been the memoirist, I fear that I would have greatly wanted to punch the toplofty git on the nose...