Your car insurance may cover a rental car while yours is in the shop if your policy includes rental reimbursement coverage and the repair is due to a covered peril, like an accident or theft.
If you weren't at fault in a collision, the other driver's liability coverage will typically pay for your rental car. If you only have the state-required minimum liability coverage, it won't cover a rental car. You'll also need to pay out of pocket if your car needs repairs unrelated to a covered peril, such as routine maintenance or mechanical breakdowns.