Usually: The starter drive not meshing cleanly with the flywheel ring gear.
But it can also be: A worn ring gear, which is a much bigger job than a starter and worth diagnosing before anything is bought.
Grinding when you start the car
A grinding noise right when you turn the key is almost always the starter not meeting the flywheel cleanly. Inside the starter is a small gear that shoots forward to mesh with the teeth on the flywheel ring gear, spins the engine over, then retracts. When that gear is worn, or the mechanism that pushes it forward is weak, it meets the flywheel teeth at a bad angle instead of sliding in clean. That's the grind.
The other possibility, and the one worth ruling out first, is that the flywheel's ring gear itself is worn or has a chipped section. This matters because a starter is a comparatively small repair, and a flywheel or flexplate job is a bigger one, usually involving pulling the transmission. You don't want to pay for a new starter and find out the noise is still there.
One test you can do yourself: notice whether the grind happens every time you start the car, or only sometimes. A worn starter drive tends to grind more or less consistently, or gets worse as it warms up. A damaged ring gear often grinds only when the starter happens to engage on the damaged section of teeth, so it may grind on some starts and be fine on others, or grind more reliably if you try starting it again right after a failed attempt without letting the engine rest. Neither test is certain on its own, which is why this is worth having someone listen to and check rather than guess at.
Also worth checking, cheaply: make sure the noise isn't coming from something unrelated bolted near the starter, like a loose heat shield or bracket buzzing on cranking vibration. It happens less often than an actual starter or flywheel problem, but it costs nothing to look.
Is it safe to keep driving? The grinding itself, in the moment of starting, isn't a safety issue for driving down the road. The risk is to the car, not the trip. Every grind wears a little more metal off whichever gear is meeting badly, and if it's the flywheel, that's the more expensive part to fix. We'd rather see it sooner than later, but this isn't a pull-over-now problem.
Sorting it out generally starts with someone listening to a cold start, checking the starter's mounting and connections, and in some cases pulling the starter to look at the drive gear and see how the ring gear teeth look where it engages. From there it's either a starter replacement or a conversation about the flywheel, with a real look at the parts before either gets ordered.