They will never get the same results !
For the first code you will notice the following
const [firstName, lastName] = first.split(",");// will cause an error if it's an array of objects you are sorting
first.lastName > last.lastName ? 1 : -1; // will cause an error if it's an array of strings you are sorting
and you also should wrap it using a return statement if you will type code before the return, JavaScript will not add the implicit return in such a case
return(first.lastName > last.lastName ? 1 : -1);
People is an array of objects containing last names, thats why it may access first lastName and second lastName
From "first" and "last" objects passed to the arrow function directly.
Array of people should be [{ lastName:"john"},{lastName:"brad"},....] the object may be also holding other properties such as firstName , age, whatever, in order to use it in that way.
While For the second code
People is an array of strings ["last,first","doe,john"....]
const [aLast, aFirst] = lastOne.split(', ');
const [bLast, bFirst] = nextOne.split(', ');
lastOne and nextOne passed to the arrow function seems to be strings contains both "last,first" separated by a comma, and after splitting you are destructuring the the array that will result from splitting "lastOne" and "nextOne" strings and use their lastName in sorting using 2 new variables that will hold values to check