Antibiotic for 7 days or 10 days

So my kids both were sick. They’re 3.5 and 14 months. Well they both ended up also getting ear infections.

My daughter (3.5) got prescribed amoxicillin for 7 days twice a day. My 14 month old also got amoxicillin twice a day but for 10 days.

Does anyone know why the difference in length of time to take it? I didn’t notice until we got home and I took the bottles out of the package. I just want to make sure they both take it long enough.