It is because the first sentence is about what 2 different persons are doing but the second sentence is about the effect of the action of first clause. In the first clause while is included because it indicates the time frame and also helps us to know when the actions of both the persons are taking place. In the second sentence But is just a connector so it is not included in the clause.
Hope it helps . Pls mark as brainliest.