I had a doubt about character arrays

ch[] {‘A’, ‘B’, ‘C’, ‘D’};

if you print these values and it prints the garbage value too, why does it stop after printing the first garbage value?
if the compiler can’t distinguish betweeen garbage values