Why is it that sometimes the 2 way valve is smaller than the size of the pipe ?
By "size" I guess you mean "diameter".
Lots of reasons - probably the same as why the pipe is sometimes bigger than the valve.
I'm afraid you need to be specific - why would you expect the valve to be the same size or large than the pipe?
I'm guessing you mean a two-way, modulating control valve? If it is smaller than the pipe, it is probably to increase the pressure drop through the valve to give better controllability. If the valve is too big, it has to close most of the way to give you the flow you need and then small movements of the valve create large changes in flow. Bad for precise flow control.
Separate names with a comma.