Let's take an example
$n = 20, \ which \ is \ not \ a \ perfect \ square $
$factors \ of \ 20 \ are \ 1, 2, 4, 5, 10, 20$
$1 \ X \ 20 \ \rightarrow 20$
$2 \ X \ 10 \ \rightarrow 20$
$4 \ X \ 5 \ \rightarrow 20$
You can see that every factor comes in pair
$n = 16, \ which \ is \ a \ perfect \ square$
${\color{Red} {factors \ of \ 16 \ are \ 1, 2, 4, 8 , 16 }}$
$1 \ X \ 16 \ \rightarrow 16$
$2 \ X \ 8 \ \rightarrow 16$
Here we can see that $4$ dosen't have any pair.
Take another example
$ n = 36, \ which \ is \ a \ perfect \ square $
${\color{Red} {factors \ of \ 36 \ are \ 1, 2, 3, 4, 6, 9, 12,18,36}}$
$1 \ X \ 36 \ \rightarrow 36$
$2 \ X \ 18 \ \rightarrow 36$
$3 \ X \ 12 \ \rightarrow 36$
$4 \ X \ 9 \ \rightarrow 36$
$6$ doesn;t have any pair
This is the reason for perfect square having odd number of factors