May I know why does different particle is used in the following examples?
は talks about a general idea. This sentence is saying 小林さん is someone who has given 'me' a chocolate. This could sound like comparing with someone else; 田中さんはみかんをくれた。
が introduces a happening. This sentence is talking about the incident that a friend gave 'me' a chocolate.
It's talking about the incident that your sister has given your daughter a toy.
が could be rather forcibly explained as it's excluding others when comparing to は. We are not really always using が to exclude others, but sometimes the feature becomes significant, for example, where 私は先生です talks about a general idea talking about my occupation, and 私が先生です says not others but I am the teacher here.
I've just found that in the top rated thread,
What's the difference between wa (は) and ga (が)?,
@jkerian is saying the same thing:
In Japanese, the thematic は is used with generic noun phrases ("the brits") or things that are already in the universe of discourse. It's sometimes tricky to nail down exactly what is there, but the general idea is that you don't introduce things to the conversation using thematic は。 This is why you cannot use question words with は, the non-specified referent cannot be in the universe of discourse. (だれは来ましたか?) <--- BAD! INVALID! DO NOT USE!
Another interesting example comes to me.
くつが一足とくつ下が四足 あります[or can be です]。
This と can be switched with a comma very well, but
くつは一足、くつ下は四足です[or can be あります]。
When it's は, our native sense simply refuses to use と here, though で works (あり for あります).
Why is that so?
は seems wanting to be a clause while が is fine to be a phrase to modify a verb.