Yoaav listened to Dovid and put Urya in the front of the war. Urya got killed and so did many other jews.
Yoaav sent a messanger to Dovid to tell him about war. The messanger told Dovid that they are strong in war and that Bnei Yiosroel could have got killed by going near the wall.
Just incase Dovid would get mad that Bnei Yisroel went near the wall, the messanger told Dovid that Urya died. Dovid said it is ok.
In this perek we saw two ideas- Din and L'fanim M'shurat hadin. One example of this is according to Din, it was ok that Dovid slept with Bat Sheva but in a L'fanim M'shurat hadin perspective, Dovid should have waited until Urya came back.
When bat sheva found out that Urya died she was so sad. She mourned.