but how do you go about creating a piece of music? Do you have to create it with a music keyboard and sample it, or is there a music notation or sequencing or package out there?
You can do either.
Some people create music with a MIDI keyboard and pipe it directly into your computer, some of them record music the old fashioned way and then digitize the results. Others use so-called 'tracker' software that allows you to sequence music directly into the computer using nothing but your keyboard and a bunch of instrument samples.
If you look around, you can also find some free musiconline that can be used in your own games.
(search for music labled either as Public Domain, or music that comes with a 'Creative Commons' license which may allow you to include it with your own creations.)