How on earth did this word get to have two such different meanings?

1.) To speak or write at length; expatiated on the subject until everyone was bored.
2.) To wander freely.
(from Atomica)