I was curious and looked up the history behind the mosque (mostly because i didn't expect a German palace to have a mosque on its grounds). Here's what I found on wikipedia: The mosque (German: "Moschee") in the gardens complex is the earliest mosque-style building in Germany. It was built in 1779-1791 by a French architect for the Prince Elector of the Palatinate. Built at a time when the "Turkish" style was fashionable in Germany, it was never intended for prayer but later served religious purposes at various times.
After many years of restoration, and at great expense, the mosque is fully restored and open to the public.