das Geheimnis
secret
Information that is not generally known or not meant to be known and is entrusted to only a few people.
Er hat mir unter vier Augen ein Geheimnis anvertraut.
He confided a secret to me in private.

secret
Loading your saved state.
secret
Information that is not generally known or not meant to be known and is entrusted to only a few people.
Er hat mir unter vier Augen ein Geheimnis anvertraut.
He confided a secret to me in private.

The word 'Geheimnis' (secret) is related to 'heimlich' (secretly). The root 'heim' means 'home' or 'private'. So a 'Geheimnis' is something that you keep private, hidden away.
Sie erzählte mir heimlich von ihrem Plan.
She secretly told me about her plan.
When it is about information between people, the first meaning is intended. When it is about the cause of a success or a phenomenon (often with the genitive, as in 'das Geheimnis des Erfolgs' — the secret of success), the second meaning is intended.
Kannst du ein Geheimnis für dich behalten?
Can you keep a secret?
Certain verbs are often used with 'Geheimnis' (secret): you can 'bewahren' (keep), 'hüten' (guard), 'für sich behalten' (keep to yourself), 'verraten' (reveal), or 'lüften' (uncover) a secret.
Er hat aus Versehen das Geheimnis verraten.
He accidentally revealed the secret.
The expression 'ein Geheimnis aus etwas machen' means that someone does not want to speak openly about something, even though it may not be necessary to be secretive.
Warum machst du so ein Geheimnis aus deinem neuen Job?
Why are you making such a secret of your new job?
In this meaning, 'Geheimnis' (secret) often appears with a genitive or a 'von' construction to say what it is the secret of: 'das Geheimnis des Lebens' (the secret of life) or 'das Geheimnis von gutem Wein' (the secret of good wine).
Er versucht, das Geheimnis des Glücks zu finden.
He is trying to find the secret of happiness.
cause
'die Ursache' and 'das Geheimnis' can both explain why something is the way it is. 'Ursache' is neutral and direct: you are looking for the cause of an event, a problem, or a state. In this relation, 'Geheimnis' refers more to the hidden or decisive factor, especially when something is successful or seems difficult to understand. Learners may confuse the words because people sometimes say: 'Das Geheimnis des Erfolgs ist ...' (the secret of success is ...). In that case, it does not necessarily mean secret information, but the most important reason. For factual problems, 'Ursache' usually sounds more precise.

Das Geheimnis ihres Erfolgs ist, dass sie jeden Tag ruhig und regelmäßig übt.
The secret of her success is that she practices calmly and regularly every day.
Die Techniker suchen die Ursache für den Fehler im System.
The technicians are looking for the cause of the error in the system.