While anal warts themselves are unlikely to develop into anal cancer, people who have had anal warts are more likely to get anal cancer. This is because people who are infected with HPV subtypes that cause anal and genital warts are also more likely to be infected with HPV subtypes that cause anal cancer.
Infection with HPV is common, and in most cases the body can clear the infection on its own, but in some people the infection doesn't go away and becomes chronic. Chronic infection, especially with high-risk HPV types, can cause certain cancers over time, including anal cancer.