What is the meaning of “in” when it comes before “which” in the following example?
An inverted sentence is a sentence in a normally subject-first language in which the predicate (verb) comes before the subject (noun). source
The “which” in your example refers to “a sentence in a normally subject-first language”, and in that sentence, the predicate comes before the subject.
Here are some more examples:
The house in which he lived only had one window. = He lived in a house which only had one window.
This is a movie in which the main character falls in love with his enemy. = In this movie, the main character falls in love with his enemy.
Poker is a card game in which players bet real money. = In the card game of poker, players bet real money.
The main word here is “which”, referring to the house, the movie, and the game, respectively. The “in” comes from the fact that you’re talking about what’s in the house, in the movie and in the game.
You can combine “which” with other conjunctions like “with” and “for”, for example:
The woman with which you came to the party just left. = The woman you came to the party with just left.
This is a crime for which the country will never forgive you. = This is a crime the country will never forgive you for.