Take a look at what Shanks does right before he destroys Kid.
1 – He tells the fleet to withdraw to protect them (and Elbaf).
2 – He asks, ‘Has he had enough time to heal since Wano?’ which indicates, not only does he know what went down, but he has shown concern for the well being of Kid who, as far as Shanks is aware, might be friend with Luffy.
3 – It’s not until he gets the information from his crew member that he passes judgement. “He sure did a lot of rampaging to make it this far.” Recall, way back in Sabaody, the reason Kid had a higher bounty than Luffy was because he’d already obtained a reputation for killing. This was before the time skip – since then, Kid also had two years of rampaging that we don’t know about.
4 – Shanks realised Kid was making an indiscriminate attack (it is shown that Shanks is using Observation Haki) that was going to strike the fleet and Elbaf. He first took preparations (moving the fleet/warning Dorry/Broggy) and once Kid commit to his rail gun attack, that’s when Shanks realised he had to act or the people he needed to protect would come to harm. Up until Kid commit to an attack, there was still time to talk.
But what was the line back in episode 1? If you pull a gun out you better be prepared to put your life on the line.
And now we see, “If you’re gonna point a cannon at someone’s home, you better be ready for when they fire back”.
Who is Shanks? Exactly who he is. Somebody who values life, but if you threaten the people who are important to him, he won’t hesitate to kill.