Modern rapid HIV tests
do not directly test for the HIV virus instead they test for signs in the body of a reaction to HIV infection.
The Alere rapid HIV test tests for 2 different proteins. HIV antibodies and an enzyme P24, both of which are created after infection with HIV.
The body takes between 14 to 90 days for these molecules to be created so there can be a delay between HIV infection and production of these molecules that would show in a rapid test. This period is called the HIV window period
For this reason if it's been less than 90 days since a potential exposure to HIV your doctor may ask you to return for a second HIV test to confirm there are no signs of HIV infection.