The 'M' (which should always be capitalized) originates from an abbreviation for the Latin word mille meaning 1000. The 'M' should be be used with numbers related to intangible and conceptual subjects like money, time, and counting. Related to the 'M' is the 'k' (always a lower-case) which is the abbreviation for kilo-. The 'k' abbreviation should be used with tangible and physical subjects like distance and weight.
Usage: The abbreviation for $100,000 is $1M.
The abbreviation for $1,000,000 is $1MM.
The confusion comes from a former symbol abbreviation of an 'M' with an overstrike or overbar. This overbar means that the mille (1,000) is multiplied again by 1,000 in lieu of 'MM'. So a number followed by an M with an overstrike means the preceding number is multiplied by 1,000,000. Since it is very difficult to create this symbol it is hardly ever seen and was improperly abbreviated as a single 'M' instead of the proper 'MM'.
because this grammar rule is little known outside the financial world, it is often used incorrectly and the slang of 'k' for thousand is often used even by venerated publications such as the New York Times and the Wall Street Journal.