Where to start with this then
There shouldn't "Theoretically" be any difference between the original Viagra and the generic copies, as people have stated the active ingredients are the same and they are effectively comparable however there will be batch to batch variation.
However the same applies to the genuine Viagra and the generic copies, i'm not worried about the reputable generic medicines but i couldn't have the same confidence in some of the shit manufactured in India / China etc
I think Doc referred to someone buying Nurofen instead of generic Ibuprofen and effectively wasting their money and this is correct as each tablet will officially contain 200mg of Ibuprofen as the active, the same is true of Sildenafil
Check the Product licence number on a pack of brand name tablets then check the licence number of the supermarket own brand ones, often it's the same thing but 5-10 times cheaper
As for each tablet containing "exactly" the same amount of active ingredient that's impossible due to normal manufacturing tolerance however the active in each tablet will need to fall within a specification or allowable tolerance
Let's say a tablet contains 10 separate ingredients, each individual ingredient or raw material will have it's own specification which also has an allowable tolerance either side of the target.
Every raw material will be randomly sampled on arrival and tested to the spec, if it's outside the spec then it's rejected, if it's within then it's passed for use.
Some ingredients degrade over time so the potency / strength etc may be different if part of a batch is used a week after arrival then the remainder in the next batch in a years time.
All ingredients will have an expiry date after which then will need to be retested to ensure they are still within spec.
Many things can affect the degradation of a raw material including the storage conditions such as temperature and humidity, was it stored at ground level or at the top of the warehouse racking where it's 10 degrees hotter, was it stored by a door that opens and closes all day long, was it in the middle of the warehouse or stored for 6 months through the winter next to a cold wall etc
If a raw material is derived from natural origin such as a plant that's grown then the variance can be a lot wider than synthetic ingredients, where was it grown Africa; Asia or Europe, what was the exact make up of the soil, when was it harvested in spring summer or autumn, had it been hotter cooler wetter etc etc etc
To get the MHRA medicine licence approval the manufacturer will need to submit 3 validation batches, the method of manufacture will need to be specified so if the instruction says to add A and B then mix it for 5 minutes in a specific mixer with specific mixing blades and X revolutions / minute then heat it to 40 degrees and mix for 2 minutes then that's what you have to do, there's no allowance for someone doing it differently.
All of the processes are validated however variations do still occur from batch to batch and within each batch but within an agreed tolerance which is checked / tested by random sampling.
I was told many years ago by someone who worked for a Pharmaceutical manufacturer that the Paracetamol ingredients were mixed in a "V" cone mixer for about 2 hours as it took that long to ensure all of the ingredients were sufficiently mixed to give consistency, apparently if you continued to mix it for longer then some of the ingredients weirdly started to separate out again
When the tablets are made the machine will dispense a slightly different weight of powder into the die meaning the active will vary from tablet to tablet etc etc