when I studied ideal transformer i understand that the flux induced in the primary circuit should be equal to the flux induced in the secondary circuit, and according to Lenz law they should cancel each other so the net flux flowing the in the core should be equal to zero. then we move to the real transformer, i saw that the difference between the primary and secondary flux should be equal to the mutual flux which NOT reaches zero, and if the difference equal to zero so the transformer will not work and induce current in the secondary will equal to zero. So why in the ideal case we want to the difference to be zero while in the real case we deal flux difference as the important flux? and from where this difference come from ?
Flux in a real transformer doesn't equal zero. That flux is called the magnetization flux and is solely due to the primary winding being excited by a voltage. So, the current that flows into the primary when the secondary is open circuit is the same as the current that flows into a simple inductor that has the same inductance as the primary winding. That current is called the magnetization current and it produces magnetization or magnetic flux.
Therefore, given that the primary doesn't have infinite inductance, there is a magnetization current. This current is 90 degree lagging the primary voltage because, it's an inductor. This current can cause significant core saturation.
Now, if you loaded the secondary with a resistor you would take secondary current and there would be a corresponding current taken by the primary in addition to the primary magnetization current. The primary load current (due to secondary current through the resistor) would be in phase with the primary voltage and is of course, quite different to the magnetization current because magnetization current lags by 90 degrees.
The primary current (due to the load on the secondary) has exactly the opposite number of ampere-turns as the load current in the secondary and hence, neither add-to nor subtract-from the magnetization flux in the core. In addition, load currents do not produce saturation in the core.