$pages = get_pages(‘child_of=’.$post->ID); Why arguments are concatenated?

It is concatenated because that”s how we combine strings together in PHP, and string is passed because arguments can be passed as a query string or an array of key => value pairs.

See the get_pages() documentation for more details.

// So both of these will work:

// 1. Pass string of arguments.
$pages = get_pages( 'child_of=" . $post->ID );

// 2. Pass array of arguments.
$pages = get_pages( array(
    "child_of' => $post->ID,
) );

So if I had to give you a reason why would I use the former (the first one in the above example), then it’d be: because it actually works and simpler in the case of the argument in question.

And one could also use double quotes instead, e.g. "child_of={$post->ID}", but if you need explanation on that, you should ask on Stack Overflow 🙂