On an aerofoil or circular cylinder why does the airflow stay attached after passing the point of maximum thickness?
This is due to the Coandă effect.
https://www.britannica.com/technology/fluidics#ref129652

In the 1930s Henri Coandă, a Romanian scientist, described what is now
known as the Coandă effect, a major contribution to fluidic
technology. He observed that as a free jet emerges from a jet nozzle
the stream will tend to follow a nearby curved or inclined surface. It
also “attaches” itself to and flows along this surface if the
curvature or angle of inclination is not too sharp. Coandă explained
this tendency as being caused by the jet stream’s entraining (picking
up) nearby fluid molecules. When the supply of these molecules is
limited by an adjacent surface, a partial vacuum develops between the
jet and the surface. If the pressure on the other side of the jet
remains constant, the partial vacuum, which is a lower pressure
region, will force the jet to bend and attach itself to the wall.