My understanding is that this action by the prophet is a kind of "sign act" to symbolize spiritual healing and atonement through the past deeds of rightous/holy Israelites. You could liken it to the Catholic tradition of a priest "annointing the sick with oil". The oil itself is a "spiritual symbol" and the priest applies it as a sign act.
To understand the specific sign act more deeply we must look at the symbology of "trees" and especially the fig tree in biblical discourse. Trees have a consistent pattern of being used as a symbol for either individual people or collections of people/nations. (Psalm 1:3, Isaiah 6:13, Psalm 52:8, John 15:1 + many more too many to list) Very often trees with special medicinal qualities were selected to symbolize God's people in scripture. Eg: Olive Tree, Fig tree, Frankincense, Myrrh etc. (why the wise men brought the gifts they did). All the products of these trees have special medicinal/sacred properties
EG: The olive tree is renouwned for its resistence to disease. Olive leaf has powerful antiseptic and antifungal properties. We still use it today in "Olive leaf extract" which is popular medicinal tool for healing colds and basic infections. These properties are used to "symbolically represent" the spiritual healing properties produced by the holy and righteous works of Gods people.
EG: Rev 22:2 And the leaves of the tree are for the healing of the
Similarly the fig tree and its fruit is used numerous time to represent Israel. And the quality of the fruit it produces in connected to the behaviour of the people. Rightous actions produce Good figs. Unrightousness produce inedible bitter/vile figs. We can see this in Hosea 9:10 where the early founders are likened to good early figs on the tree. But later because of the idoltary of Israel the fruit of the fig tree is said to be turned "vile".
We see this symbology repeated again in Jeremiah 24 which calls the Israelites headed into Exile in Babylon to perform atonement as a basket of "Good figs". The remnant who refused to go into exile and perform the atonement work are called a basket of "Bad Figs" which are inedible and will be destroyed.
3 And the Lord said to
me, “What do you see, Jeremiah?” I said, “Figs, the good figs very
good, and the bad figs very bad, so bad that they cannot be eaten.”
4 Then the word of the Lord came to me: 5 “Thus says the Lord, the God
of Israel: Like these good figs, so I will regard as good the exiles
from Judah, whom I have sent away from this place to the land of the
Chaldeans. 6 I will set my eyes on them for good, and I will bring
them back to this land. I will build them up, and not tear them down;
I will plant them, and not pluck them up. 7 I will give them a heart
to know that I am the Lord, and they shall be my people and I will be
their God, for they shall return to me with their whole heart.
Here we see again the good fruit of the fig is linked with righteousness and sacrifical atonement/repentance of Israelites. Thus the cake of figs can be understood as representing the "fruit" produced by past atonement work or righteousness of Israel. It is very similar (though peraps less powerful) to the symbology of the atoning "blood of the lamb" offered through christ. It is a "healing remedy". The fruit cake being placed over the boil - symbolically acts as a "covering for sin". The boil then heals and king is granted 15 years additional life.
Here whats important to recognize is that though the natural product - the fig cake produced by the tree - may have healing properties itself - in prophetic symbology they aren't actually whats being used to do the "miraculous healing" and extension of life. They are merely "symbols" to represent the atonement work of Israel's "good fruit" being used as a "salve" for the unrighteousness of the individual being treated - King Hezekiah. As such it should very much be considered a miraculous or spiritual healing.