From the outside, a sewing machine is a wonderful bit of magic. A needle shoves thread up and down, and somehow a seam is formed.
Here's a little YouTube video of this:
What is that thread latching to? How, if the needle just bobs up and down, does the thread lock in place?
A great GIF reveals what is going on inside the machine as the needle does its little dance:
Beneath the needle (as the GIF shows at a very slowed down speed) a hook rotates, capturing the thread from above and looping it around another thread, this one reeling from the bobbin below. The two threads interlock around the layers of fabric, binding them to one another.
So it's not magic; it's mechanics. And to me, that's even neater.