Heat and work are not the state functions of the system. Why? 
Heat and work, unlike temperature, pressure, and volume, are not intrinsic properties of a system. They have meaning only as they describe the transfer of energy into or out of a system.

This is the extract from Halliday & Resnick.
My chem book writes:

Heat & work are the forms of energy in transit. They appear only when there occurs any change in the state of system and the surroundings. They don't exist before or after the change of the state.

So, heat energy is dependent on the path or the way the system changes, right? So, are they saying, for one path connecting two states, more heat energy can be liberated while for another path, less heat is released? How? For the same two states, how can there be a different amount of heat energy liberated? Is there any intuitive example to understand this?
 A: You and a friend are in front of a mountain. You both are at 100m elevation. Therefore you are in the same state. Now you walk up to the top, your friend takes the bus. Then you both compare how much energy you spent on your ways. You spent a lot more than he did. A third person comes and shows you the amount of energy he needed to go up by bike. 3 different levels of work done. But still you are all at the same state, for example 1100m elevation. 
A function works like f(x) = y. If someone tells you how much energy he spent, can you tell him exactly, how high he got? If not, "energy he spent" is not a function of the state.
A: At the microlevel, if you were to keep track of all the degrees of freedom of the system, then all of the internal energy change would be accounted for as work, and heat exchange would always equal zero for any process. Whenever energy is exchanged, this is always due to molecules interacting with each other and thus performing work on each other.
The whole point of thermodynamics is to provide for an effective description of macroscopic systems like heat engines, or what goes on in a chemist's test tube, in terms of only a few macroscopically accessible parameters, such as total internal energy, pressure etc. Now, in general, the equation of motion of a system consisting of, say, $10^{23}$ molecules will not yield a closed description for only a few of its macroscopic characteristics. But if certain conditions are met, which boil down to the assumption of thermal equilibrium, then this does work.
The macroscopic description of a system is in principle always arbitrary; you decide how to split up the, say, $10^{23}$ degrees of freedom into the few that you decide to keep track of. The remaining degrees of freedom are treated statistically; they enter the equations as temperature, entropy, heat, etc. Work is defined as the change in internal energy due to the change in the macroscopic external parameters of the system you explicitly track. Heat is defined as the energy exchange that is due to all the degrees of freedom you do not explicitly track, which you only treat statistically. 
So, the reason why internal energy difference alone does not specify the performed work, is because the internal energy difference is defined already at the microscopic level. The whole accounting for what part of the change is heat and what is work is only defined after you specify how to define the effective thermodynamic description of the system. If somehow internal energy change also defined the amount of work, then any alternative thermodynamic description would have to yield the same amount of work. However, we know there is always a description available where the entire internal energy change is due to work.  
A: Suppose a person wants to reach the 4th floor from the 1st floor and he can take two ways: one through ladder and other one is through lift. In both cases, his initial and final state is same, but in both cases, the amount of heat he released is different. Therefore we can say that heat is path function not the state function.
A: Suppose you have a thermodynamic system in a state $A$. In this state it has a certain amount of internal energy, $U_A$, because internal energy is a state variable. You can determine the internal energy by knowing only the state.
Now suppose the system undergoes some process - you don't know (or care) what - that leaves it in state $B$. Again, you can determine its internal energy by knowing only the state, and that energy will be $U_B$.
Clearly, to get from state $A$ to state $B$, the system had to gain a net amount of energy $\Delta U = U_B - U_A$. That fact is true no matter what the process was. Hopefully that's all clear so far.
But hopefully it's also clear that how that energy was transferred to the system depends on the process. There are many - or, well, at least several - different ways by which energy can be transferred in or out of a system, such as electromagnetic radiation, sound, gravity, or physically pushing on something. Different processes will use different methods, or different combinations of methods (because it's possible for a process to transfer some energy by EM radiation and some by sound, for example).
We've broadly grouped these methods of transferring energy into two categories, heat and work. Generally, the methods which involve the system pushing its environment around (or vice-versa) count as work, while others count as heat. (This should make sense because you need force and a change in position to have work.) So depending on the process by which the system gets from $A$ to $B$, the amount of energy transferred by heat methods and the amount of energy transferred by work methods can vary. Any basic thermodynamics textbook will give several examples to show how the distribution of energy transfer between heat and work depends on the process.
Of course, the total amount of energy transferred through all methods is always the same: it always has to be $\Delta U$. That's just energy conservation.
A: Think of it like this. When you have an object of mass $m$ which is held a height $h$ above some reference point, you think of it as having potential energy (considering only gravitational interactions) $U= m g h$, and gravity will exert an amount of work $W_g = m g h$ on the object. When you drop the object, it shall fall towards the ground, towards “equilibrium”, so to speak. You do not speak of the amount of “work” that the mass has when at its original height, nor of the amount of “work” lost, but of its energy (relative to a reference point) at any given state, $U$. Moreover, we say that this potential energy is a state function because it depends only on the initial and final heights of the mass in question.
In the same way, one does not concern his or her self with the amount of “heat” that an object has, since it is merely a term used to denote the amount of transferred energy between systems as they move in and out of equilibria. We speak of thermal energy, internal energy, free energies and such that are state functions of the system - in exactly the same way that the gravitational potential energy $U$ was in the mechanical analogue to this thermodynamical case. In the same way, we say that the thermal energy of the system is a state function insofar that it generally depends (more or less) on the initial and final temperatures and thermodynamic quantities of the mass in question.
Edit: I’ve reread your question and I want to make another point to clear things up. Yes, indeed, different paths can result in different amounts of heat transfer - the first law of thermodynamics states:
$\delta E = Q + W$,
wherein $Q$ is the amount of heat flow into the system, $W$ is the work done onto the system, and $\delta E$ is the total state internal energy change of the system. One can see that one can input say, 100 J of heat and do no work on a system to result in a net change $\delta E$ of 100 J, and in the same way, one can divide that $100 J$ amongst $W$ and $Q$ to get the same effect. 
The intuition is as follows. Imagine you have a jar of gas. You can increase the temperature (and so impart a positive $\delta E$) by adding $100 J$ of heat, or you may compress it by doing $100 J$ of work to gain the same effect. I hope that clears things up!
