It is true that breastfeeding is considered the best supression of ovulation due to the increase in prolactin level. However, as lactation is reduced, the prolactin level returns to its normal state. This is not immediate and, therefore, if pregnancy is not desired, contraceptive protection is recommended.
In addition, we should not forget that, although it is rare, there may be female periods in which there is ovulation but no menstruation.
Therefore, even without menstruation, there is a possibility of pregnancy after childbirth, although it is low.