Regarding the for loop, it's not magic either. "For comprehensions" in Scala are a wonderful syntax sugar that can look like familiar "for loops" for Java folk, or familiar "do loops" for Haskell folk depending on how you use them.
But they always desugar to flatMap/map/withFilter method calls that you could have written yourself -- there is nothing "special" about them in that regard.