Great balance and precise movements.
Not unlike how it's kind of miraculous that humans are bipedal. Walking on 2 feet on uneven terrain and up stairs is pretty impressive too.
On top of every one else's mostly correct responses - Practice! Goats climb on and jump off of everything they can from birth. They have a real urge to get up on stuff and as babies they are terrible at it with lots of tumbles but they get better and better with time. r/goatparkour
[because they crave that mineral. ](https://m.imgur.com/t/mineral/uwt3i6c
On a more serious note, they have hooves that have evolved to be able to climb these almost straight surfaces and I'd assume a lot more muscles than we do as humans. Also probably a combination of speed + muscles + agility --> climbing up mountains
Edit: "designed" -> evolved
Because it's indeed only seemingly completely straight, a different angle: https://imgur.com/a/5g2zX
That picture is probably cut in that strange way only to hide what reveals it's not a vertical wall.
To start with their hoofs are very sharp and their legs are thin. So even if there is a slippery piece of rock sticking half an inch out from the cliff they can put their weight on it without slipping. They also have a lot of balance and control over their movements so they can balance on those narrow ledges. And of course it does help to have four legs. So just like a rock climber can climb seemingly straight smooth surfaces a goat can use a lot of the exact same footholds to climb up.
How often do goats fall to their deaths when climbing up weird and vertical walls and cliff faces?
Rigid, hard-rubber style hooves, and a lot of free food for scavengers at the bottoms of cliffs.
Goat hooves have a more rubbery texture than horse or cow etc hooves. They have grippy toes.. Plus, they're super agile/adventurous. Goats get themselves in all kinds of weird places.
The have weird hoofs it's like a horses on the outside but a dogs soft in the middle giving them lots of grip.