The amount of calories in your body (that is energy stored in your body, most of which is stored as fat) really is the difference between the calories that went in minus the calories that went out. That is a true statement, it's physics, but it tells you nothing about weight gain and weight loss or how to control it.
What you eat has complex interactions with your hormones and that controls whether calories are burnt, turned into fat, or excreted. That is, you can control how much you put in your body (i.e., the amount you eat), but you don't have direct control on what happens to that food once it's in there, what the food is has the biggest determination of that.
The single biggest thing you can fiddle with is how much you eat in the way of carbohydrates. There's a lot of subtleties to this, but the big picture is that a high carb diet signals your body to store rather than burn calories (I.e., gain weight no matter how much you eat or how much you exercise); a low carb diet signals your body to burn rather than store calories (I.e., lose weight no matter how much you eat or how much you exercise).
Granted, you can take either extreme and over or under eat and bad things will happen. But for a reasonable intake of food, a lower carb fraction will promote more fat burning than a higher carb one. The value of reasonable is pretty large (I eat 5,000 cals a day and exercise for about 10 minutes a day and I've been at 175-185 lbs for 5 years). Also the values of low and high for low carb and high carb are dependent on each individual, you need to experiment with yourself and see what works. Don't listen to nonsense like <50g/day, or <100g/day, or <150g/day. Go with what works for you. But the trend is there: low carb is more fat burning than high carb and if you're low enough you can pretty much ignore calorie count. Your body will figure out what it needs and adjust your hunger and metabolism to match rather than you trying to outsmart it by controlling your calorie intake.
Edited to add: to answer your question. If you ate 1,200 calories with 200g of carbs, what would likely happen is that the high carb intake will spike your blood sugar which will spike your insulin and drive sugar into your fat cells. That is, you will store the energy. If you are not insulin resistant, you insulin will come back down later and later you'll be able to burn the fuel as it comes out of your fat cells. However, if you are insulin resistant (and not fat-adapted - like most non-paleo people), you insulin will not come down to levels that allow the energy to come out of your fat. So even at 1200 cals which is likely a deficit to what you need, you'll be storing energy rather than burning it. Since the energy will be trapped, your metabolism will slow and you'll feel tired. So you'll be eating a small amount of food, that food will be stored as fat, you'll gain weight, and you'll feel tired and cold. For your other example, if you ate 3,000 cals with no carbs, then there's nothing to turn on the insulin (yes, protein can do it, but it's a small effect), so you won't be able to store any of that. Since you'll have extra fuel around that you cannot store, your body will have to figure out what to do with it. Your metabolism will ramp up and you'll just burn more fuel at idle (get warm), but you'll also feel like doing stuff. Your body will tell you to get up and do something rather than just sit down and watch tv. This points to one of my favorite quotes from Gary Taubes: "You're not fat because you're lazy. You're lazy because you're fat". That is, when you're signalling storage of fuel, you necessarily have to find ways to save energy since you cannot burn it. Conversely, when you're not storing it, you have to find activities to burn it.