Many possibilities. Ingrown nail could develop due genetics or due to tight shoes, trauma, fungal toenail infections, and incorrect cutting of the nails. One should always try to cut the nails strait across to avoid leaving an embedded nail spicule. If you develop pain or redness get it looked at by a professional.
It may hurt, but... There is a small piece of nail still embedded in the corner. You need to get that out. If you can't get it out on your own, a podiatrist can. Sometimes this can be done without numbing the toe, but often, anesthesia is necessary. If it is a chronic condition, there is a very successful surgery that can be done to permanently correct the problem.