It seems like there's a lot of overlap in function between the 3 throughout the war. The STuG and Panzer IV both started out as infantry support vehicles but were retrofitted with different guns and used for killing tanks. So you've got Vehicles like the Jagdpanzer 38(t), Panzer IV and STuG III all having very similar performance. So i'm wondering if they used them in the same way they would a Panzer.
The upfront answer is yes. As the war situation became more dire for the Germans, STuGs and Jagdpanzers were increasingly used instead of tanks in Panzer formations.
The major difference between a "Panzer" (or a tank) and a STuG/Jagdpanzer (For the purposes of this discussion, from this point forward I will refer to them as "SPG" for "Self Propelled Gun" for brevity) is obviously the turret. In terms of tactical employment, the turret allows the tank to engage a multitude of targets from a variety of positions. The SPG must orient it's entire hull in order to fire (with some limited traverse obviously).
On the defensive, this is less of an issue, generally the tank or SPG crew has some time to find a firing position that enables them to cover some portion of battlefield regardless of turret or not. On the offensive this is a major issue, as getting the main gun into action with the turret is a fairly straight forward affair, and the vehicle orientation is less important, while the SPG is going to have a lot more difficulty being brought to bear on enemy targets as they are detected.
Which is to say the tank and SPG do not offer similar performance. On the defense, the differences are much more modest, but both the Allies, and Germans (and modern military forces) tend to view the tank as an offensive weapons system. And on the offensive, the SPG is not as useful.
With that said, in terms of industrial production the SPG is MUCH simpler to make. Turrets require lots of gearing, motors, and they impose a significant weight penalty. When you drop the turret, the remaining hull can be given much more armor, and a larger gun, AND be produced a lot faster than the tank that would otherwise be based on the hull. Also for the Germans who had significant issues with industrial production, while the Panzer III was unable to carry a gun or armor to stay relevant on the battlefield, the STuG III based on the hull was, and remained relevant to the end of the war.
So as the Germans were increasingly up against the proverbial wall, and as the Panzer situation became more dire, SPGs were increasingly used to fill that gap. The main types offered in lieu of tanks were STuGs or Panzer IV/70 (also referred to as Jagdpanzer IVs). As discussed they were a lot easier to make, and on the defense were at least somewhat close to what a "real" tank would be able to do.
StuGs were initially part of the artillery arm, grouped into batallions and deployed to support infantry attacks- their existence was in part an example of German military extravagance, in part to placate the infantry since almost all the tanks were organised into armoured divisions, and in part to modernise the artillery and recognise that infantry had to attack fortifications and 'hard' targets like villages, but tanks did not need to be distracted by this. The Sturmartillerie was an elite force.
In late 1941-42 the Germans had something of a panic- stopped outside Moscow, they had to survive a winter in Russia, still fighting, and being opposed by tanks harder to stop than anything seen before. They threw long-barrelled anti-tank guns onto anything they could, and that included the StuGs. Still remaining in their distinct battalions and still mostly for infantry support, the StuGs nevertheless found themselves being used in the anti-tank role more often, and the vast, open terrain of the Eastern Front meant the war was very much based on AFVs (armoured fighting vehicles).
It was also at this time the German high command started mounting large anti tank guns on obsolete tanks and smaller vehicles that otherwise could not survive on the battlefield. This was mostly to give anti-tank guns, already an intrinsic part of infantry divisions, some mobility. They usually had little armour, and were for the most part improvised. This sort of vehicle remained in this role until the end of the war.
After Stalingrad, Goebbels famously demanded the German people rise to the challenge of 'Total War', and the German war economy was heavily reorganised for mass production. Heinz Guderian, sacked a year earlier, was brought back as 'inspector-general of tank production', his brief to re-equip the depleted German tank divisions, and find equipment for expansion. It was from this period that tank divisions were beginning to be padded out with armoured vehicles other than proper tanks. Guderian commissioned new designs of turretless vehicles, the Jagdpanzers (being artillery weapons the StuGs were theoretically outside his jurisdiction, in any case the artillery wanted their elite corps to survive- Nazi Germany was full of little empires). Jagdpanzers were cheaper than tanks and could mount a desperately-needed large gun on chassis that were in full production, but which were too small to mount a competitive gun in a turret (for instance the Panzer MkIII could only carry a 50mm gun as a tank, but a 75mm as a StuG). Unlike the earlier Panzerjager conversions, they had proper armour and could participate fully in the armoured battle.
By mid 1944, in many Panzer and SS Panzer Divisionen one battalion of the two within the division, were either StuGs or Jagdpanzers (even the best divisions had one of Panthers and one of near-obsolete MkIVs, or one of Panthers and mixed second battalion). In defensive warfare, the lack of a turret was less important. There were attempts at standardisation, notably in the E-series vehicles that did not quite get into production, but as it stood factories were encouraged to churn out whatever they were best at.
By late 1944 the entire Panzer Division system was breaking down, in attritional defensive warfare the high command was reduced to throwing whatever forces were available into the endless breaches and crisis points of the line, and German armoured units became very mixed.