Healthy fish can live a long time without added food in a well-established, heavily planted aquarium. There are several key parts to this.
First the fish have to be healthy and in good condition. This means that they have normal body mass and are not already emaciated or sick. The tank also can’t be overcrowded.
Temperature is important. Most fish are exothermic, or cold-blooded. The warmer the temperature, the higher their metabolism is. I recommend keeping most tropical fish at 74–76 degrees F. Warmer temperatures may be necessary for some fish, such as Discus, but most tropical fish do fine at 75 F. Warmer temperatures may also be needed to induce spawning, but fish will live longer at the lower end of their temperature range and need less food.
A well-established aquarium and a lot of plants are also important. Every surface in contact with water suitable to support life quickly becomes covered with a biofilm of bacteria and algae. As this biofilm develops in a healthy aquarium it adds more complex organisms such as ciliates and rotifers, and eventually may support a small population of copepods. This community is called “Aufwuchs” and in the wild it is a food source for many fish. Plants add a lot of surface area and also remove chemicals from the water.
Smaller fish are more sensitive to starving because they have less relative body mass, but they are also more likely to be able to graze on aufwuchs. I generally advise people that if they go away for a week or less, they are better off just turning off the aquarium lights and not having someone come in and feed the fish, even Bettas. Overfeeding is far more likely to kill fish than underfeeding, at least in the short term. If you have been taking good care of your fish, doing your water changes, and properly maintaining the equipment, the fish should be fine for a week, and as you found out, even longer.
The main risks of leaving the fish alone for extended periods are a power outage and a filter that will not restart automatically. If the tank is not overstocked and is well-planted, this may not even be a problem. An extended power outage in the winter can also be a problem if the room temperature drops too low. Many tropical fish can tolerate the upper 60’s and even 65 F if the change is gradual, but that is around the lower limit for many of them. A power outage in the summer can also be dangerous. Many tropicals can take the upper 80’s and even the low 90’s but this puts a lot of stress on the fish, lowers the amount of dissolved oxygen in the water and can kill them. Anabantoids, such as Bettas and Gouramis are adapted to these high temperatures and have a labyrinth organ that allows them to breath atmospheric air. That is why Bettas can be kept in a small container. The other risk is if a large fish dies while you are away, it could pollute the tank and kill the remaining fish. If you only have small fish, the other fish will probably eat the dead fish and it won’t pollute the aquarium.
So it is not surprising that the fish survived a month while you were away, but they probably lost a lot of body weight. You should take extra care of them until you get them back in peak shape. You may want to feed them smaller amounts 2 or 3 times a day and do extra water changes.