What's the meaning of fasts, is it only a physical deed of abstain from food and drinks? Because often in scriptures it's listed or placed in context of prayer, repentance, mourning or done to show a certain depending on HaShem. What has a physical deed of abstaining from food and drinks has to do with all of this? It helps us humble ourselves or afflict ourselves but where does this lead to, what is it's meaning to do this through fasting?
I come from the mindset that no law is strictly physical/spiritual. They blur into one another and provide benefits which merge those aspects.
Fasting is powerful in a spiritual sense because you are choosing to take control of a baser instinct. Hunger is as basic as breathing or sleepiness, so by choosing to overrule that instinct in reflection of a spiritual observance/exercise you are strengthening your divine traits and suppressing primal traits. Torah teaches that the Nefesh HaBehamit "animal soul" is in conflict with our Nefesh Ha'elokit (divine soul)
If you are interested in a more detailed explanation of the parts of the soul, you can read more in the Tanya at this link:
These comprise two different sections of our soul which are in a battle for control. By doing spiritual exercises (such as fasting) you can drive down the animalistic urges and raise yourself to a higher state of craving. You can move from craving that which is harmful to craving that which is beneficial if you practice and focus your time/energy. Fasting is just one of those exercises.
Fasting also has a symbolism associated with it in relation to the pain that hunger causes. When we observe Tisha B'Av (just one example) we fast. This holiday is a memorial in reflection various wrongs of Jewish history. One of the main reflections is on the loss of the holy temples (first and second).
Some reading regarding Tisha B'Av and the tradition of the observance:
This hunger pain is symbolic of the spiritual pain of our people. We sit in hunger and reflect on this pain and attach that pain to the wrongs and errors of Jewish history. By doing that, we take an impersonal history and we connect to it. I can't know what it was like to lose the holy temple because I never had the holy temple. That doesn't mean I can't reflect on what that loss has done to my ancestors and my peers of today.
By connecting the pain of our people to a pain which is rooted in our biology, we groom ourselves to make the suffering of our past a part of who we are. That strengthens us and drives us to honor the past, make peace with the present, and overcome the trials and tribulations of the future.
A very detailed reading regarding the purpose of fasting in relation to Judaism:
From a physical/scientific standpoint.
Fasting has been found to promote health benefits when done in a controlled manner over regulated periods of time. They recently discovered that if an individual fasts for a period of three days, their immune system resets itself.
Your body uses the time without food to correct issues on a biological level.
Keep in mind, these are controlled fasts which are not extended beyond this period of time. Going beyond this period of time can harm you if you withhold sustenance for too long. Our bodies need nutrition to function correctly.
R' Hirsch writes in Horeb that the purpose of all fast days is Teshuva, and gives the following explanation (ch. 33, Dayan Grunfeld's translation):
Fasting, i.e. abstaining from all kinds of nourishment for one day, should help in mastering the animal in man, in calling a halt to striving for self-gratification and in showing that a firm will can well remain the victor. It should also bring home the thought whether what made it possible for us to control our impulses and cravings - or, at any rate, the most pressing ones - for one day, could not make it possible for every day; and if we cannot control all such impulses, then at least we should shun the impure, the exuberant and the forbidden. Fasting, therefore, should contribute towards the eradication of one of the sources of sin, pleasure-seeking.
Fasting is meant to demonstrate to ourselves the ability and purpose of not indulging in the physicality which leads to sin.
Fasting is a way of attaining a more spiritual state/frame of mind by disconnecting from physical pleasures. This more spiritual state is more conducive to Teshuva. See Nesivos Olam: Nesiv Hateshuva chapter 7 (beginning from the second paragraph) and Derech Hashem part 4 chapter 8:5 (regarding Yom Kippur).
However, today it is not recommended to fast (apart from the biblically/rabbinically mandated fasts) because it weakens the body and impairs the ability to think and learn Torah (Krina D'igrissa 1:16,17).