MIDI stands for Musical Instrument Digital Interface. You don't need to understand what that means to write MIDI music, though. The sound card produces the musical notes and sounds that you hear. It is basically a synthesizer.
Sound cards come in all varieties.
The difference is similar to the difference between a cheap toy keyboard and a grand piano. If you want to write your own music though, you need to download or buy a MIDI sequencer program that lets you record as well as play MIDI files. If this seems confusing to you, think of a wind-up music box. With that in mind, think of the sound card as the metal comb. The MIDI sequencer program is the motor and the roller-wheel.