Boundary layer separation is caused by air slowing down to zero and reversing before reaching the end of the body. This is due to friction (viscous effects) + adverse pressure gradient.
The formation of an adverse pressure gradient can be explained by the geometry of the body. In the case of an airfoil, for example, the way I see this is that after air has been accelerated around the leading edge (strong curvature), it flows to the rear part of the airfoil (less curvature), and experiences a "collision" with the straighter surface. That collision causes a rise in pressure - an adverse pressure gradient.
Air inside and outside the boundary layer is slowed down by the same amount because of this pressure gradient. But I don't understand why. Air already slowed down by friction should "collide" less strongly with the surface, which implies a less intense adverse pressure gradient. Why will all air, regardless of some being decelerated by friction, experience an adverse pressure gradient of the same intensity?
There might be some misconceptions in my understanding, so I would appreciate any correction and assistance!