How does a child get warts on his knee?

By contact. Warts are obtained by contact and he may of fallen or scraped his knee.
By papilloma virus. Warts are caused by papilloma virus infection, from a small abrasion on the knee.
Seeds planted. You get warts if/when you come in direct contact with the wart virus at the location where that contact created the conditions where it could take hold.