The HPV virus is the cause of plantar warts and is spread through direct contact. If you have a break in the skin, like a small cut or graze, then you may contract the virus through sharing the same surface like a shower or a floor. Once you contract the virus, it may take months for the wart to develop.
Immune systems do respond differently and not everyone that comes in contact with the virus will develop plantar warts. Similarly, a weakened immune system may make you more susceptible to contracting the virus.