Mechanical shifting is the way most people expect a bike to work. Move the shift lever and it pulls a cable that changes the gear. It works just fine but it's undeniably the inferior choice given modern options.
Electronic shifting sends a signal to the derailleur and a motor changes the gear for you. It's superior in almost every metric you can think of. The cables never need to be replaced and never break. Adjustment is easier and even works quite well while riding. When you can't feel your fingers, you can still shift without issues. The batteries last for months and in some cases, you can bring extras. The only downside is the price.
The whole groupset will cost more if you choose to go electronic but individual components are the bigger concern. Gravel bikes spend time off-road tackling challenging conditions. A broken rear derailleur isn't unheard of and you are looking at a repair bill that's double the price if you have electronic shifting. For rough and tumble gravel bikes you might consider staying with mechanical shifting only so you don't have to worry about breaking something.