Basically how you use them is up to you. They are just data files that contain all the data to create the song when played on a suitable device like your keyboard.
They have some advantages over audio files - they are small size so don't use much memory, they are easily edited and manipulated on your keyboard.
Some people use them to play on their keyboard, some play along with them, but probably the most common use is to make a recording on midi first, then do all the editing/correction before turning into an audio file.
Big disadvantage is that they cannot be used for vocals, or external instruments. But you can play them, while you layer a vocal onto audio, and a lot of people do this.
Mike