The drugs used in prep and hiv meds are the same.
So my understanding of the drugs used in the diferent regimes is ;
If taken by someone who is hiv -ve as prep it protects against becoming infected.
If taken by someone who is hiv +ve as hiv meds it protects against transmission. (antiretroviral hiv drugs if you prefer)
No that's an oversimplification. Firstly let me clarify we are talking about low risk levels.
Let’s assume that person A is engaging in frequent high risk sexual activity and therefore taking PrEP. (this will be a daily dose combination of tenofovir and emtricitabine which are two of the drugs which may be used to treat HIV).
Lets assume that unfortunately they are either unlucky or don’t take it properly and they become HIV+. Until they are tested they will not know of such and therefore pose a risk to person B unless person B is also taking PrEP to reduce their personal risk. The PrEP regime of person A is no longer relevant in terms of protecting B.
Once tested positive you would assume person A stops unsafe sex (at the very least) and begins a full blown antiretroviral treatment (ART) which can be quite a complex cocktail in comparison to PrEP and tailored to an individual. ART is a highly specialised field of medicine. If and when the treatment proves successful and the viral load is almost entirely suppressed, that person would then pose an extremely low risk to others. That can take some time.
It is that period when the PrEP has failed to protect A, but they are unaware they have become HIV+, that person A is a risk to person B, as neither A or B is aware of A’s HIV status. Hence if you are regularly practicing very high risk sexual activity for everyone's benefit very frequent testing of HIV status is needed.