Most pregnancies last an AVERAGE of 38-42 weeks. Since 40 is in the middle of that range, that's where they assign the estimated due date. This is also why some docs won't consider you late in order to induce labor until closer to (or past) 42 weeks.
Since the AVERAGE menstrual cycle is 28 days, and most women KNOW when their last period began, but not necessarily when they ovulate, it's easier to count weeks of pregnancy beginning from the 1st day of the last period. Like previously stated, calendar months are not even, so they count weeks since they are a specified length of time.
I've seen the number of weeks per trimesters divided up several different ways. Here's how my doc said to look at it to make it easier to understand...
They give you 2 extra weeks at the beginning (before ovulation) because most women KNOW when their last period began but not necessarily when they ovulated. And they give you 2 extra weeks at the end because average pregnancy length is 40 weeks (remember the range is 38-42 weeks) from the first day of the last period. This variation makes your pregnancy look like this:
Weeks 1-6 = 1st month (1-2 before ovulation, & 3-6 after ovulation)
Weeks 7-10 = 2nd month
Weeks 11-14 = 3rd month
Weeks 15-18 = 4th month
Weeks 19-22 = 5th month
Weeks 23-26 = 6th month
Weeks 27-30 = 7th month
Weeks 31-34 = 8th month
Weeks 35-40 = 9th month (Wk 40 = estimated due date)
This is how my doc explained it to me to make it easier to understand. I hope that helps!