They do not work like antibiotics, and you need to take them continually for them to work. This is because HIV integrates into the genome, so once you're infected it's too late. HIV's polymerase is very error prone, so these drugs are fake C's that can't be attach to anything after they're used. The result is that the HIV is inactivated before it can complete the infection. HIV cannot develop a resistance to this if taken consistently and regularly. The issue is if people stop taking it, get infected, and then resume taking it. That can lead to resistance.
Truvada used to be expensive, but was required to be covered as preventative care. Then the patent expired a few years ago, and it became very cheap (and also available in more countries). However, Truvada doesn't have high bioavailability, which means you need to take large pills and it can put stress on your kidneys filtering it out.
The same company came out with a new one, Descovy, that is basically a more bioavailable version. Tiny pills, less kidney stress, but of course still covered by the patent so expensive. I haven't seen it outside of the US for that reason, and in the US some insurers won't cover it unless you get a priori authorization for why Truvada won't work for you (kidney issues would be one such reason). Other US insurers cover it fully (or enough that the manufacturer's copay card covers the balance).
The current injectable version is every 2 or 3 months, and is designed for people who have compliance issues taking a pill daily. Or are in unstable housing situations, etc. You really don't want people to get infected and then take PrEP drugs, because it can cause resistance. HIV treatment includes additional drugs, not just these.