Yup. Not only is it Open Source, but there's a plethora of blog posts and articles just a Google search away that'll explain pretty much every aspect of how Rails works (seriously.. it's been blogged to death and back).
When people say it's magic, what they're really saying is: "It's unfamiliar to me, and I'm to lazy to go find out how it works. So rather than just STFU, I'm gonna complain about too much 'magic'." :-)