What causes a car to be more expensive for car insurance?

I need to buy a car but I'm unsure what causes the car insurance to be more expensive, is it based on mileage? Engine specs? Car year?