Basically yeah. At a super rough level of understanding, the CPU can compare two integers with one instruction, but has to loop through a whole string[1] one character at a time to compare two strings for equality.
[1] Yeah yeah, CPUs & standard libraries are smarter than that, I know, I know. You get the point.
[1] Yeah yeah, CPUs & standard libraries are smarter than that, I know, I know. You get the point.