Carbohydrates convert to glucose. Your body requires insulin to process glucose so the ingestion of carbohydrates triggers an insulin response. Insulin is the hormone that triggers fat storage. Long term, too much insulin leads to insulin insensitivity and Metabolic Syndrome, and then to Diabetes and other very serious problems.
It does matter what you eat, not just how much.
You only go through that cycle if you’re not doing anything with the energy. People training eat a lot of carbs, they have to, it’s the only way to give their body the energy it needs, and it’s not getting stored as fat, it’s getting burned. Labeling an entire food group as bad just because some people consume it wrong is just as wrong. Carbs are perfectly fine, IF you’re going to do with them what your body WANTS you to do with them.