Yes they do. They have to prove that their version of the drug works in the same manner as the original via clinical trials.
At an absolute fraction of the cost of a new drug. All they need to do is prove their drug formulation has the same bioavailability as the branded drug. The cost of doing that is measured in a few millions of dollars.
But do they invent the right medicine formula for the disease?
Public universities have done that for most of the significant discoveries in the past few decades.