[verb phrase] + 焉
焉 + [verb phrase]?
焉 at the end of a classical sentence stands for "in it", "from it" or "there" – a place or source already mentioned. Modern Chinese keeps it in proverbs and quotations, and above all in 心不在焉 "absent-minded", literally "the heart is not there".
In the second line, 焉 is "among them". It often follows a verb of arising or having: 有…焉, 兴焉 "arise from it".
At the front of a verb phrase, 焉 asks a rhetorical question, "how could" or "where would", and expects the answer "it couldn't". Several proverbs are built on it.
The position decides the meaning. At the end, 焉 points to a place and makes no question. At the front, it questions and points to nothing. 心不在焉 is a statement, not "where is the heart?".