Why are there songs in OSTs and music albums that don't appear in the anime?
The Opening and Ending tracks are normally shorter for anime, as the songs were usually originals developed before the anime and the artist was paid for a portion of it to be used in the anime, not to mention that the songs also need to fit in broadcast time. On the other hand, there are also Opening and Ending tracks which were purposely made for the anime (or the other way around like the case of Black Rock Shooter).


  Some songs are even from full albums by the bands or singers in the anime, but they also didn’t appear in the anime either.


These are probably the singles where Opening and Ending tracks come from, like with a lot of ALI PROJECT's album, as I said above, sometimes an artist is paid for just a portion. Of course, there's nothing stopping an artist building an album around that song as well.

Certain BGMs are sometimes actually a number of BGMs from an anime which were split, which is why sometimes there seems to be some songs missing.

There are also Character CDs, which have audio dramas of a character who had an identifiable theme in the anime, plus extra songs. These can normally be identified with the album art focusing on the characters alone.

Then there are Audio Episodes, I haven't heard to many (and I only know of the Code Geass ones). They use some tracks from the anime, but they also use music unique to the audio episode.