Yes, the connection engine unfollows people. For example, if you change your industry from real estate to banking, the connection engine unfollows people in real estate and follows people in banking. Likewise, if you change your location from New York City to Los Angeles, the connection engine unfollows people in New York City and follows people in Los Angeles.
That being said, the connection engine does not unfollow people that you have followed manually. It also does not follow people that you have unfollowed manually.