A before and after picture from two different cameras
Say you painted a room and want one picture that shows it before and after. The before photo came from an old phone at 3264 by 2448 pixels. The after photo came from a new phone at 4032 by 3024. Side by side at their own sizes, the after photo would stand taller and the pair would look uneven. Choose both, keep "Side by side (same height)", and they are matched to the shorter one, 2448 pixels tall.
Both photos are 4:3, so both become 3264 by 2448 at that height. With a 40 pixel white gap, the result is 3264 + 40 + 3264, which is 6568 pixels wide and 2448 tall. The result line states that size before you press the button, and the preview shows the gap in its colour. If the order is wrong, press Earlier or Later beside a picture in the list.
Matching to the smallest is a deliberate choice. Enlarging the 2448 pixel photo to 3024 would invent pixels and blur it, while shrinking the larger one loses detail nobody would see at the size the pair is viewed. The same rule applies to stacking, with widths instead of heights. A phone screenshot 1170 pixels wide stacked with one 1080 pixels wide gives a column 1080 pixels wide, with each screenshot kept in its own shape.
Some combinations would be too large for a browser to draw. Ten 6000 by 4000 photos side by side would make a picture 60,000 pixels wide, past the limit a browser can draw in one canvas. In that case the whole layout is scaled down until it fits, and the result line says by how much, for example "scaled to 27%". Nothing is cut off, and the gaps shrink in proportion.
There are honest limits. Up to 20 pictures can be combined at once, each up to 8000 pixels on a side. The layout is one row or one column; for a grid, combine in two steps. The pictures are not cropped, so pictures of different shapes give a row of different widths. The result is saved in the first picture's format, and camera details and location are not copied into it.