When is SELECT necessary in PL/pgSQL functions?
This is only an educated guess.

It seems that the SELECT is unnecessary because it's already present, e.g. in the implicit SELECT ... INTO that an assignment := is equivalent to. From the documentation:


  An assignment of a value to a PL/pgSQL variable is written as:
  
  variable { := | = } expression;
  
  As explained previously, the expression in such a statement is
  evaluated by means of an SQL SELECT command sent to the main database
  engine.


An example may be shown here, where:

name := (SELECT t.name from test_table t where t.id = x);


can also be written as 

name := t.name from test_table t where t.id = x;


This seems possible because the second simplified form is equivalent to a SELECT INTO in PL/pgSQL:

SELECT test_table.name INTO name FROM test_table WHERE id = x;


The first form would be equivalent to:

SELECT (SELECT t.name from test_table t where t.id = x) INTO name;


, which has a redundant layer of SELECT that can be removed.

On the other hand, when an implicit SELECT is not present, an explicit SELECT seems necessary. For example, the same function cannot be used directly (i.e. without SELECT)

string_to_array(my_str,'_');


if it's not in an assignment to a variable.