What is the difference between the fusion reactions up to the element iron and beyond?

Up to the element iron, the fusion reaction is exothermic and there is a net energy output which makes the star shine. Beyond this, the fusion reaction is endothermic and there is a net energy input at the expense of the internal energy of the star.

How are the heavier elements beyond iron produced in a star?

The heavier elements beyond iron are produced only in certain kinds of stars called supernovae where the very high energy inputs required to sustain the necessary endothermic fusion reactions are available.