How can the xbox 360 run games pc's can't?

This has made me wonder for a while now. So, the Xbox 360 has only a 3-core cpu, and 512 mb of ram. It's video card has only 10 mb of v-ram. Yet, it can run games like Battlefield 4 at 30+ fps!
Now, MY pc has 2 gb of ram, a dual core cpu, and a video card with 1 gb of v-ram. And i can't run jack ****. I can barely run MINECRAFT at 20-30 fps.
So, how is this?
The 360 has much worse specs than most computers, yet it runs games just fine.
How?

Because the 360 version can be optimized to run on just that hardware, obviously the graphics are toned down greatly compared to the PC version… Look at Battlefield 4. It's a night and day difference.

Short term: The console is dedicated to the games and does nothing else.

Programmers for PC titles know that if the game runs a little slow, the gamer will run out to Best Buy and drop $200 on a new GPU or more memory. In addition, their employer will have them out on the street and replace them with a busload of Full Sail grads if they don't deliver on time, so you might say that PC game developers are characteristically lazy and sloppy with their code. It doesn't really matter, because video game code is rarely if ever re-used.

But since the 360 has a fixed hardware set and can't be expanded, it's imperative that the programmers wring every last bit of performance out of the system for as long as possible. And it's easier, because there's no mistake as to what hardware the gamers are running.

The 360 came out in 2005. Think back to what a top-of-the-line dream gamer PC would have been back then. I think around that time the Pentium M was popular and the Core 2 duo wasn't out yet. Can you imagine what Battlefield would look like on that system?

Well, consoles are designed to play games, unlike PCs. And games are optimized to run on the console, using that hardware