How is the acceleration of all the blocks same in this problem?

Solving this problem requires additional assumptions which are not stated.

For this type of high-school/freshman question you should assume block C is frictionlessly constrained to move only vertically and to remain level by the channel in which it runs.

If it is not constrained to be level, or if it can move from side to side, then it could either tilt (if the strings are attached at different points) or move from side to side. This complicates the analysis, and I haven't attempted to solve for that.

Notice, both the strings of blocks A & B are tied to the (same) block C which moves vertically downward with a certain acceleration. Block C pulls & causes both the blocks A and B to move with the same acceleration. However the tensions in both the strings will be different depending on the masses of blocks and the friction conditions.

It can be explained by string constraint.Block A and C share the same rope and also the blocks B and C.So,for the string to remain taut(between A and C)both should have the same acceleration and also the same reason for B and C.