
einfallen
to occur to
An idea or memory suddenly comes to mind. The verb is often used with a dative object.
Mir ist gerade eingefallen, dass ich noch meine Mutter anrufen wollte.
It just occurred to me that I still wanted to call my mother.
to occur to / collapse / invade
Loading your saved state.

to occur to
An idea or memory suddenly comes to mind. The verb is often used with a dative object.
Mir ist gerade eingefallen, dass ich noch meine Mutter anrufen wollte.
It just occurred to me that I still wanted to call my mother.

to collapse
To cave in or collapse in on itself. Often used for buildings, roofs, or pits.
Das Dach der alten Scheune ist unter der Schneelast eingefallen.
The roof of the old barn collapsed under the weight of the snow.

to invade
To enter a foreign territory or country with military intent.
Die feindlichen Truppen sind im Morgengrauen in das Land eingefallen.
The enemy troops invaded the country at dawn.

to come in
In music or singing, to begin playing or singing at a certain point.
Nach dem Gitarrensolo fällt der ganze Chor wieder ein.
After the guitar solo, the whole choir comes in again.

to become sunken
Refers to the face or cheeks becoming thin and hollow due to illness or hunger.
Nach der langen Krankheit waren seine Wangen sichtlich eingefallen.
After the long illness, his cheeks were visibly sunken.
'Einfallen' (to occur to / collapse / invade) is a separable verb. The prefix 'ein-' comes at the end of the main clause, while in a subordinate clause it remains attached to the verb.
Plötzlich fällt mir die Lösung ein.
Suddenly the solution occurs to me.
The perfect tense of 'einfallen' (to occur to / collapse / invade) is always formed with the auxiliary verb 'sein' for all meanings. This is because the base verb 'fallen' (to fall) describes a change of state or movement.
Mir ist eine gute Idee eingefallen.
A good idea occurred to me.
You can recognize the very different meanings from the subject and the sentence structure. A person in the dative points to an idea. A building as the subject points to collapse, and troops as the subject point to an invasion.
Dem Autor ist ein besserer Titel für sein Buch eingefallen.
The author thought of a better title for his book.
When an idea or memory comes to mind, the person who has the idea is in the dative. The thing that occurs to someone is the subject in the nominative.
Was fällt dir zu diesem Thema ein?
What occurs to you on this topic?
In the meaning 'eindringen' (to enter / penetrate), 'einfallen' is almost always used with the preposition 'in' and the accusative to name the target of the invasion.
Historische Berichte beschreiben, wie die Wikinger in England eingefallen sind.
Historical accounts describe how the Vikings invaded England.
The past participle 'eingefallen' (sunken) is often used as an adjective to describe a thin, hollow face or cheeks. It then comes directly before the noun.
Nach seiner langen Krankheit hatte er ein schmales, eingefallenes Gesicht.
After his long illness, he had a narrow, sunken face.
to come
Auf eine Idee kommen and jemandem einfallen can describe the same result, but from different perspectives. When someone actively finds a solution, they kommen auf it; an idea that often suddenly appears in someone’s mind fällt that person ein and is used with a person in the dative.

Plötzlich fiel Lea die richtige Lösung ein.
Suddenly, the right solution occurred to Lea.
Nach langem Nachdenken kam Lea auf die richtige Lösung.
After thinking for a long time, Lea came up with the right solution.