Briefly even number of days was considered unlucky so months had 29 or 31 days, but they needed one even number of days month and February got unlucky. Then they began messing with it more.
there’s no need to memorise the poem. look at the knuckles on your fist excluding your thumb’s. four knuckles three indents. start with the knuckle on your index finger and count, going back to it when you reach the end.
I learned a slightly more dramatic variant of that: Instead of counting on the knuckles and gaps between them, count on the fingertips (thumbs excluded) and in between the knuckles.