The Janissaries served in the standing army of the empirical army for the Ottoman Empire. As professional soldiers they were stationed in Chania, and ruled the island on behalf of the Sultan. They needed a mosque, and this is what you see here today. Of course it was also used by Muslim Turks and others who lived in the area.
The first collection of Janissaries were from descendants of prisoners of wars and Ottoman slaves. Like the Mamluks before them, the Janissaries also drafted only teenagers who not Muslim, strong, and 15 years and older. They were Christians who were forced to convert to Islam, on their own accord, to be allowed to draft them to the unit.
The Janissaries were the first unit in the Ottoman Empire's standing army, their loyalty was guaranteed because of their non-Muslim status, they had neither the ability nor the will to rebel against the Sultan, unlike other possible Muslim unites.
In addition, the Janissaries wanted to prove their loyalty to Islam. The fact that many Turks did not want to be in the infantry unit for its inferior image compared to the cavalry, also helped.
The salaries and stipends the Janissaries received were excellent, and due to their vitality to the Sultan, they lived a life of abundance and comfort. But over the next few centuries they gained strength and reached a level that they controlled the government and even replaced sultans.
In addition, the Janissaries became rich and spoiled, and as a fighting force they became weak. In order to preserve their power, the Janissaries opposed the renewal of the army, which led to technological standstill for military methods, this led to defeat in the Battle of Vienna in 1683, and plunged the empire into "Europe's Weak Link." The Sultan, who wanted to advance innovations in the army, was overthrown, but his successor fought them, and finally destroyed the imperial army of the Janissaries, taking all of their possessions and mercilessly slaughtering them.