The trouble is that there's a cycle where lessons are often the only way to access regular swimming.
Pool provision is down generally. School provision is reduced and not even. Pools like the regular direct debits of lessons so put those on rather than ad hoc attendance at general sessions, so there are few general swim sessions other than a couple of chunks at weekends.
We've often done casual swims at weekends and holidays, but not regularly enough to crack swimming with a dyspraxic child (the other is dyslexic with interesting executive function too, but more co-ordinated). It's mainly as a fun thing to support their interest in the benefits of being able to swim. There was a phase of awkwardly spaced lessons where we did a casual swim to break up the time, and the pool was surprisingly quiet. That session was recently dropped due to lack of demand.
The reality is that a lot of familes aren't avaliable 4-6pm because of work commitments. Those that are find it simpler to commit to lessons rather than casual sessions.
Pool timetables are a lot more regimented than they were 20+ years ago.
I used to be able to turn up to a "general swim" which had lane provision roped off and that ran all morning. The school lessons were held at the other swimming pool. Now the pool has been replaced with a modern complex, the other pool shut down and the pool's provision is very much segmented into school, lessons, lanes, aquafit, float fun, ninja warrior etc and there's little casual time when a parent could teach their child. And when there is a casual window, it's bedlam which isn't easy for a child. While lessons of 12 aren't a fast-track way to learn, at least it's orderly and everyone is working at the same tasks.
Then there's the ability of parents to teach. DH couldn't... he can't do much more than doggy paddle himself (never taught, lack of experience). I can swim but having learned late on, I can't necessarily extrapolate that into effective teaching for a child. I wouldn't have known to start with things like blowing bubbles to encourage breathing.
A lot comes down to aging infrastructure and poor funding in the past 15 years. Group lessons can be cost-effective per child compared to paying for a whole family. Our pool allows the DCs to swim for free at general sessions, so I only pay for myself for those. But to go as a family, there's not much change out of £20 per session. And that's a cheap pool. At the modern one, it's at lesst £8 per head per session which is dearer than the cost per lesson.
While we haven't fast-tracked through, our slow group lessons method has kept DS1 swimming weekly until 14. He's not interested in many sports, and at least it's been useful weekly exercise, and bonus, he's now a strong swimmer with stamina.