The story
Originally a literal phrase, the cost of doing business, i.e. the ordinary expenses of running a commercial enterprise. The figurative sense, with the expanded meaning of any accepted negative consequence involved in pursuing a goal, became established in American English by the mid-to-late 20th century.
Etymology from Wiktionary, CC BY-SA 4.0.