trim always cleans the data. Expecially if its for a password or user data that needs a check.
eg
$user=" Foo"
$pass="pass "
This data input will fail without trim to clean the unwanted spaces.
Mostly they are not seen but alway do trim exp. when data are comming from form inputs.
:)