That's not obvious at all; there's no reason creation of new drugs couldn't be financed by raising capital through either debt or equity issues, which are then paid back, in effect, by the profits from the drug itself; in fact, a fair amount of drug development is funded that way, because it's done by startups which are acquired by major firms, if at all, only after doing much of the development work; obviously, that's how every firm’s first drug is financed.
It may be that firms want to eventually shift business models, so at some point they take their existing stake of drugs and body prices so instead of paying off their own development, they are doing that and paying forward development, and after that switch to internal financing, but there is no reason that is obviously a necessity.