Records are broken because training is different, it's harder and better. Increased competition is a large part of this, what used to be exceptional and record setting is the norm because everyone is being pushed to that pace.
Not just swimming but all sports in general, people are full time athletes now in a way they have never been. So they have the time to dedicate themselves to insane amounts of training.