There have been two generations (so far) of Apple's Magic Mouse. The first had replaceable batteries, while the second had a built-in battery that you had to charge.
There could be several reasons why a Magic Mouse loses its Bluetooth connection, but the most common reason is a loose battery contact in the Magic Mouse.
The battery compartment of the Magic Mouse has what appears to be a weak design for the battery contacts. It is possible for a slight shock, such as lifting the mouse to move it, to temporarily cause a disconnection between the battery and the battery terminal inside the Magic Mouse, breaking the electrical connection. No power means no Bluetooth connectivity.
The disconnection can be caused by a weak spring in the contacts or a bad contact design. Either way, this low-tech solution can help: