On the point about the relationship between acheiving higher education and atheism/ leavin religion. There seem to be somewhat of a correlation there, but obviously correlation is not causation.
Another big factor between religious observance is
hardship and poverty, poorer people or people of less fortunate circumstances tend to be more religious. Religion is a powerful to bind a community together and make self-sacrifice and the enforcement of sociality norms easier.
As people gain wealth, which has the biggest correlation between education level and the amount of money you earn, not only do they correlate, having a good education will mean you will make more money. This greater wealth allows for erasure, as the community gets replaced by individualism, believing that everythign they got out of live was their own doing.
So it is not education, but the wealth and welfare it entails in the modern western economy that erodes religious believes.
"...education is not tied with disbelief in God" - Sociologist Philip Schwadel
A nomad in Somalia feeling the rain touch his skin after a very long dry period can only thank Allah SWT, an upper class person buying a drink can only thank himelf, this removal and the stresses of life and survival being so far gone for this people make atheism and individualism a very attractive philospical grounding.