The generic contains the same active ingredients and with the same dosage. What can change is the other ingredients. You're not supposed to have side effects by changing brand unless you're intolerant or allergic to one of the different inactive ingredients. Sometimes the inactive ingredients are the same.
The generic is as effective as the original. Sometimes, we can see a small difference but it's usually when using a medication with a narrow therapeutic spectrum (ex. for thyroid or epilepsy). Other times, the difference can be caused by a psychological aspect (ex. placebo effect). Few people will have a real difference with medication for blood pressure, insomnia, diabetes, pain ... but it's very rare.
As for antibiotics and antivirals (like the PreP) there's almost 100% chances that the generic and the original will have the same effectiveness.