Can someone explain the logic behind low-card diet to me?

My biology knowledge mostly comes from my high school education, and what I've been told was that carbs are the main energy source, fat is the energy source for storage, and protein is the last source if the first two are not available. To have a balanced meal, you're supposed to get mostly carbs, lots of protein to build up your body, and not too much fat. And then I ignored health-related topics for years because I was young and healthy. Now I'm a little older I'm trying to figure out a more balanced diet, after a little digging around it seems the only diet you should have is low-carb diet, and rice and bread all of a sudden become the source of all evil.

From my understanding, low-carb diets try to cut down the carb intake so the body starts to use more fat for energy, so fat will become the main energy source, and then you will need to eat a bunch of fat to get full. The idea of fat as the main energy source sounds so wrong to me, isn't fat strongly correlated with heart problems? And if we don't eat rice and bread what should be the main food in a meal? A giant piece of butter? I'm also aware people are trying to make a distinction between whole grain and processed sugar for carbohydrates, the reasoning seems to be that whole grain contains extra nutrients that processed sugar doesn't have, but without the extra nutrient, aren't the carbs part of whole grain equally bad? Then why do we tolerate brown rice instead of white rice if we're still getting the same amount of glucose? It all feels very inconsistent.

I'm also not very sure if the low-carb diet is only targeted to people who need to lose weight or people in general because after reading multiple articles and watching youtube videos, it seems these types of diet give you every single benefit you can imagine and you will magically be healthy by switching to it. I'm underweight and I'm actually trying to be fatter, does a low-carb diet still make sense for me?

Overall I think what bothers me the most is the fact that low-carb diet completely contradicts what I learned about nutrition in the past, but it's so prominent and it's been advertised everywhere. It was a weird experience as if it's either everyone is crazy or I'm crazy. Is low-carb diet a new consensus in this field or I was just taught with outdated knowledge? Or maybe low-carb diet targets a specific audience and it's not good for everyone?