>>7078000In the research phase they come up with tens or hundreds of thousands of generally similar molecules, after multiple rounds of tests and several years they throw away the trash and just keep one
then they develop a method to manufacture it in large scales, at this point they apply for a patent
Then the authorities begin appearing randomly at the factory, obviously there are strict regulations for purity and all kinds of other things and they keep checking those until the end of the registration process
Then they begin the animal tests, they have to use purebred dogs or monkeys with well documented genetics and pedigree and these animals cost a lot. What it looks like is they run like a half year long test on a bunch of dogs and then kill them to see if their organs are healthy or damaged. If the latter then the whole thing goes into the bin after sinking $800 million - $1.5 billion into it
If the former they proceed with tests on people, first paid volunteers, then larger group of people, then it appears in the pharmacies, but the doctors keep giving feedback and if something goes wrong they just pull it
The whole process from coming up with an idea for a medicine to the point that it can be sold to the public takes around 20-30 years and costs $1.5 - $3 billion
It's possible that at this point they still don't have their patent accepted though, it can take up to 15 years, and the patent is for 20 years. After the 20 years have passed, the molecule becomes generic which means anyone can freely use it to make their own medicine which obviously drags down the price a lot