After 5 years, you will become a “long-term resident” under EU law but it does not make all that much of a difference.
After 5 years, you can also apply for a Niederlassungserlaubnis but there are a number of conditions to meet, most importantly:
- Having contributed to the social security system for 60 months
- Knowing (some) German
- Having a job, sufficient means of existence and room to live in
- Good morality (and in particular no criminal conviction)
The requirements for Blue card holders are somewhat lighter (e.g. 21 or 33 months instead of 60, depending on your knowledge of German). “Simple” knowledge of German is required in any case.
It is permanent in the sense that once you have it, you have a stronger protection against any removal and don't need to regularly renew it and prove you still meet the conditions (you do need to get a new document with a new photo once in a while, including when you get a new passport but that's a formality). You are also free to take any job or stop working without threatening your right to stay in the country. You can however lose it if you leave Germany for more than 6 months.