Programmers use them to quickly validate a larger data structure which could crash if it guesses the type wrong, using the theory that whatever code put the magic number there probably got the rest of it right, since they would have made it store the magic number AFTER everything else checked out.
Usually it's something easy for a programmer to remember, like DEADBEEF or B00B135 or something equally assinine.
It's like a secret signal or whistle you might use with friends when trying to coordinate something sneaky.
2. The 6-9 combination in pool, especially 9 ball.
3. 69 (the sexual act).
2. Look! All I have to do is hit the magic number and I win this rack. The 6-9 combination--ooh, la la, so soon!
No wonder those two are so quiet: they must be performing the magic number on each other