Which sentence uses commas correctly?

(A)When a bat’s squeaks hit an object, they echo back to the bat’s ears, and that is how bats use sound to find their prey in the dark.

(B)When a bat’s squeaks hit an object, they echo back to the bat’s ears and that is how bats use sound to find their prey in the dark.

(C)When a bat’s squeaks hit an object they echo back to the bat’s ears, and that is how bats use sound to find their prey in the dark.