It was pretty common at the trailheads I've used (Northern Ontario, a hundred miles or more from any house) to see keys left in the cars and the cars unlocked. Sometimes the key would be left dangling from an external lock. The people who were doing this were basically saying "look, if you drive all the way up here and there's something in my car you want, I realized you're going to get it. I'd rather not deal with a smashed window on top of that." Also, they were preventing the possibly fatal problem of losing their keys at the bottom of a river and being unable to drive home.
Assuming you're not comfortable with that, remove and hide your GPS and its mounting brackets (and clean the "mounting brackets were here" marks.) Put everything out of sight so that the opportunist won't get inspired to smash your window. That includes your phones and other electronics you chose not to take on the trail, a large quantity of coins (we have 1 and 2 dollar coins, so $10+ is easy to have lying around visible), and anything that suggests your vehicle belongs to someone with plenty of money. If you have a suit hanging up in the back to change into when you get back to the car, you're probably one of those people who keeps $100 cash in the car for emergencies. Don't look like that and it's less likely to be a problem.
I think that's one reason why "key in the lock" works. I think it says "go ahead, look around, there's nothing for you here" and the opportunist knows the more cars they look in, the more likely they are to be caught, so they decide not to waste their time on that car, which must be pretty empty.