Almost any game with more than two passwords probably uses either a logical or mathematical scheme for deriving those passwords—the programmers aren’t just going to hard code them all in! The Mega Man games are no exception. Although some games have a simple scheme, others must keep track of a large number of options, such as P-Chips or Bolts, which can make things quite interesting.
Generally these cracks and generators were created for the original system(s) that the game debuted on. They may or may not create functional results for remakes such as the X Collection.