The most common cause is sexually transmitted infections. But there are many other possible causes. Some penile ulcers may heal on its own. Many people need treatment to prevent the symptoms from getting worse. With treatment they can avoid the complications and spread to others. With successful treatment, one can fully recover.
Unprotected sexual activity increases the risk of contracting these infections, emphasizing the importance of practicing safe sex and regular STI testing.