In this question is the sentence
The city must have been prosperous, for it enjoyed a high level of civilization.
Although I understand the meaning, I must admit I never realized "for" could be used as "because", which I discovered in an online dictionnary. I also don't remember any lesson about it in school (but I basically only had a few hours a week in secondary school and then learned by myself, so this might explain that). Therefore I was wondering if it can replace "because" in any occasion and any level of speach or if there were "rules" indicating you should use one rather than the other (or even forbidding to use it)?