How were lands governed that were partially in the HRE and partially not? Was the Prince, King, etc... beholden to the Holy Roman Emperor or not, considering only some of their territory was in the empire.

by Donuil23

I do know that the "empire" changed a lot over the years, and what may have been the case at one point, may not have been the same later.

Here's an example of what I'm asking. On the Holy Roman Empire wiki page, under Modern Period;

By the rise of Louis XIV, the Habsburgs were chiefly dependent on their hereditary lands to counter the rise of Prussia, some of whose territories lay inside the Empire.

So how was Prussia governed if it lay both in and out of the empire?

Sorry if the question is unclear and rambling.

Notamacropus

There's actually several instances of this. From the end of the Thirty Years War up until the Congress of Vienna Sweden held lands in today's north-east Germany (Swedish Pomerania), which made the King of Sweden de jure a subject of the Holy Roman Emperor. Practically, it really only meant that the King of Sweden in his role as Duke of Pomerania had a seat and voice in the Perpetual Diet of Regensburg, the Holy Roman Empire's lawmaking facility.

Even more important, the Duchy of Brunswick and Lüneburg (informally, and from 1915 onwards formally, the Electorate of Hannover), which was made an additional elector and thus one of only nine princes who had the power to elect the next Emperor. Having just been elevated to an electorate in 1692 the House of Hanover then went and got themselves a nice new island home when, in 1714, George I. got himself firmly seated on the throne of Great Britain, giving the British monarch a direct influence in Holy Roman Empire politics and even elections until in 1837 due to different succession laws the crown of Hanover went to Queen Victoria's uncle, Ernest Augustus I of Hanover, instead. Even if by that time the HRE was no more anyway.
Although with Hanover the electorate role was rather constricted, since to ensure his appointment to elector status George I.'s father, yet another Ernest Augustus (of Brunswick and Lüneburg this time), had promised his house's eternal vote for the firstborn Habsburg son.

Prussia itself originally referred to an area outside of the HRE controlled by the Teutonic Order, named after the Western Baltic Pagan tribe that originally lived there. During the 15^th and 16^th century the state of the Teutonic order crumbled away, was integrated into the Kingdom of Poland until eventually Ducal Prussia was given as a hereditary fief to the House of Hohenzollern by Poland, starting the Prussian line of the Hohenzollers.
When that line ended in 1618 the Duchy went to the other Hohenzollers, dukes of the Electorate of Brandenburg, thus making them subjects to both the Holy Roman Emperor as Dukes of Brandenburg and the King of Poland as Dukes of Prussia until the great militarist Frederick William managed to buy Prussia's independence with the Treaty of Wehlau in 1657 (a result of the rather complex Second Northern War).

Using this independence as a base in 1701 his son, Frederick III., strived and eventually succeeded to have Prussia made into a Kingdom, in part for his personal prestige but mostly to stay competitive with the other electors - the newly elevated Hannover being in line for the British throne and Augustus II the Strong, elector of Saxony, having risen to the throne of Poland-Lithuania in 1697.
More correctly, Frederick III. was crowned King in Prussia, not of. Partly because the King of Poland still held and considered himself King of Royal Prussia but also because the Holy Roman Emperor had not wanted another kingdom inside the Empire - the only royal crown being the one of the Emperor (and Bohemia, also held by the same person). Regardless, the capital, administration and royal court remained in Berlin and Prussia was very much an influential member state with some outside land in the greater scope of things.

Sources:
Whaley, Joachim: Germany and the Holy Roman Empire

Aethelric

I unfortunately am not an expert on Prussian governance, so I can't give you a full answer on the specifics of how the state was ruled. I can give you an idea of how the Holy Roman Empire worked, however, that will serve to answer your questions in an oblique way.

The short answer is that, particularly after the Protestant Reformation (most of Northern Germany became Protestant, while Austria remained ruled by the Catholic Habsburgs), few princes in the Empire felt truly "beholden" to the Emperor at all, and many Protestant princes went to great lengths to oppose the Emperor's will where ever possible. The legal and political apparatus of the Empire held some power over the princes and their lands, namely through taxation and adjudication, but this apparatus was dominated by the assembly of the princes themselves—the result is something vaguely resembling a very unruly and weak parliament with often open hostility to the monarch. Naturally, what little influence the Empire could directly wield over Imperial lands was irrelevant in non-Imperial territory. Probably the largest concrete difference I can speak to is that Imperial lands were often a patchwork of competing legal codes and jurisdictions, often with exclaves of Free Cities and independent princedoms, while ruling Prussia itself could be done much more evenly and simply.

Other princes relied primarily on each other for aid and support. In the run-up to the Thirty Years' War, for instance, both Protestant and Catholic factions developed their own so-called "Leagues" for the organization of defense and diplomacy. Before this, in the 1540s, the Protestant princes of the Empire developed the Schmalkaldic League and sought to create an alternative imperial structure in opposition to the Habsburgs.

Basically, the Emperor could really only get his way by force, and several wars—against the Schmalkaldic League, against the Swiss, against the Protestants in the Thirty Years' War—proved his ability to use force effectively to be highly tenuous. As Prussia grew in power and influence, their access to territory outside the Empire was less important in terms of directly countering Imperial authority (although it did allow the Hohenzollerns to become "Prussia" instead of Brandenburg, thus netting them the title "King") and more important in terms of providing additional lands, people, and wealth.

My main source for the details here is Thomas Brady's (excellent and highly recommended) German Histories in the Age of Reformations, 1400-1650.