Ottoman State:

Similar to the Abbasid Caliph or Sasanid Shahanshah, the Ottoman Sultan was both a religious and an imperial figure in charge of an autocratic state.   he was considered the caliph of Sunni Moslems and the Sultan of the empire.  He claimed loyalty to the Shari'a as the prime law of the land.  But where Shari'a did not cover, the Sultan issued Firmans [decrees or orders].  Sunni Moslems all over the world looked to the Sultan for protection.
The classical Ottoman society was divided into two major categories of classes, namely the Askeri and the Ra'ya; the ruler and the ruled; the elite and the subject; the warriors and the producers; the tax-collectors and the tax-payers. This arrangement was unlike Arab vs. non-Arab of the Umayyad period.  For example, people of Christian origins could grow in status and power.  The status of an "Ottoman man" was created which could be reached by birth, education, military rank, or Moslem religious learning.
During the period of expansion (the classical age 1400s & 1500s), the Ottoman administrative culture and system of law took shape. 
Ottoman State: the state structure was absolutist and had a military character; the Sultan [who also used the Persian title Padishah [Pasha is a composite term made up of pa (in Persian, foot) and shah (in Persian king), so it literary means "at the foot of the king"] and on many instances the religious title Caliph was at the top of the state hierarchy as both an Islamic and an imperial absolute ruler; soldiers were for the most part his slaves; the imperial territory, his personal property
It was the Ottoman state structure that allowed this arrangement; its military character was from the Ghazi (nomadic) era, and absolutism gradually imposed on the descendants of the Ghazi warriors; it came to be an efficient and centralized structure during the heyday of the empire; Byzantine administrative ideas were added after the fall of Constantinople.
In this state structure, the army [now with the introduction of gun-powder and artillery, more that ever dominated by the infantry] was the most important element and everything else was built  according to it; as the empire enlarged [under Selim] the most important segments of central power were organized in a single grand army with the Padishah at its head; within this army, not only soldiers but many types of administrators held military ranks and were compensated by Iqta' or increasingly military payroll; this army [thus administration] was at the personal service of the Padishah; military\slave system of the past [Abbasid-Mamluk] reinforced this; as the role of infantry [particularly the Janissaries] became more important in the army, so did the slave system which it was based upon, both in the army and the administration (Divan).
Hence, the Ottoman state [1300s to 1400s] was turned from a nomadic, warrior like Ghazi state into an imperial state run by a "military" imperial servant class whose members were recruited from among the Christian population as slaves; these were converted to Islam and trained in special imperial schools; those with more intelligence and aptitude for civilian administration were sent for Divan duties and those with more warrior capabilities to the army.
The Sultan's personal day-to-day duties were taken over by the Grand Vazir [a slave]; this office had a high place under Mehmed II, but under Suleyman its authority was shared by no one but the Sultan; in this absolutist arrangement, the position of the Grand Vazir was only vulnerable to that of the Sultan; the Grand Vazir stood at the head of the whole state apparatus [divan]; was the effective commander in chief in war and master of fiscal and even judicial services in peace; at his side were lesser vazirs with little independent power. The seat of the Grand Vazir was referred to as the Bab-e Alli or the High Gate [French Sublime Porte] and was placed in one of the palaces of Istanbul. Troops were commanded by three chief generals [Bilerbegi] of Rumelia, Anatolia and Arab Lands. 
The old Turkish aristocracy had little room in this arrangement; militarily, it was associated with the Sepahi cavalry contingents; economically with the iqta'; Sepahi was the cavalry force the igta' holder was responsible to provide the center in time of war and it was losing its importance rapidly as modern warfare [with its emphasis on infantry] made it obsolete.
The Turkish aristocracy held no real power in this military\absolutist structure; moreover, the new aristocracy [say the Arab lands] who were allowed to hold iqta' and man special infantry corps, were used by the Sultan to keep the Turkish Aristocracy in check; by the 17th century, it almost became a requirement for a high Ottoman post (apart from Shari'a positions) to be filled by a Moslem who did not belong to the old established aristocratic families;
This process was insured legally by the requirement that an official be formally the personal slave of the Sultan [which legally exempted Moslems by birth]; the inheritance of such officials was given to the Sultan; but if it was decided that it was to go to his descendants, then the receiver of inheritance was supposed to enter the ranks of Ottoman aristocracy and be excluded from government trust; if members of the old families wanted to rise politically, they had to become the "slave" of the Sultan, as many did. The state structure explained above was dominant in the 16th and well into the 17th centuries. 
Shari'a & Absolutism:
Shari'a played an important role in all the Moslem empires.  In the Ottoman Empire too, it served to tie together the imperial court and the more popular urban life [through its communal (umma) claim] and it became an inspiration of higher cultural forms of courtly life. 
In this arrangement, the Sunni ulama enjoyed a correspondingly high role.  The prevailing ulama had always tended to accept the de facto military rulers of Islamic societies which often amounted to outright alliance.
After the fall of the High caliphate, the ulama legitimized, to a certain degree, the amirs, where as the amirs in turn were expected to leave the ulama as a body essentially involved with their own local sphere of operation. 
In the Ottoman Empire the ulama came under state control, but by doing this, the Ottoman state brought the Shari'a into the center of state life.  In this arrangement, the Sultan achieved a more extensive authority, including a fuller control of the Shari'a aspects of society, while the Shari'a and its representatives in turn were more fully recognized and found a solid place in the absolutist order of the Ottoman state. 
The relationship between the ulama and the state was not as a result of a sudden imposition of a new regime, but out of slow evolution in which the original differences between Ghazi warrior [who had strong Sufi tendencies] culture and the bookish ulama culture were replaced by profound respect for them as holders of communal solidarity.  The Ghazis, and later the Ottomans, fought on behalf of the Moslem umma as a whole, this the ulama represented.  This reality gradually impressed itself upon the state; e.g. Selim imposing Sunni orthodoxy [Hanafi School] and massacring the Shi'as before Chalderan in order to enforce communalist conformity.
Under Sultan Suleyman the Magnificent (1520-1566) or Qanuni, who presided over the empire in its classical age, central institutions of the Sunni (Hanafi) jurisprudence were most definitely codified.
Under these circumstances, the ulama gained great prestige and authority.  Their training was lengthy, in order to limit new comers to their ranks; they produced the empire's Qadis and Muftis.  The Grand Mufti of the realm resided in the capital and was referred to as the Shaykh al-Islam; during period of state weakness, this position became so strong that at points it was able to interfere in politics and even dispose a Sultan. 
But under normal circumstances, when the state was still very strong, the ulama were closely integrated into the state; their organization centered in Istanbul; their head could be dismissed at will by the Sultan.  Entering the ranks of the ulama, became a path of upward mobility for those members of the old aristocracy who wished to reach high positions in the state apparatus; this avenue was closed to the slaves.
Sultans issued Firmans [decree or order] and created Qanun [law from Greek word Canon], but within the sphere of Urf or precedent and Shrari'a.  These laws were decreed with respect for the Shari'a and Urf.  It was to the ulama to certify the law as consistent with the Shari'a; nevertheless, some of these laws did not originate from the Shari'a tradition and it was to the ulama to find a way to legitimize them.
During Suleyman's rule, Abdul Su'ud Khoja Chelabi (1490-1574) was the Shaykh al-Islam (1545 on) and had become the greatest legal mind of the empire; he worked out a system whereby the process of Shari'a accommodating the state was justified;  of particular importance in this case was the doctrine that Qadis derived their authority only from the Sultan, and therefore were bound to apply the Shari'a according to his directives.