Why can you not compare mouse.Target values to String values?

Pretty much what the title says
I am using a local script and below you will see what kind of mouse service I am using. I do not think I need to show code samples as this is more of fundamentals question.

local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer -- from a LocalScript
local mouse = Player:GetMouse()

…Because mouse.Target returns a BasePart?

Why would you be able to compare it to a string value?

Sometimes it returns nil, simply have a check:

if Mouse.Target then
    if Mouse.Target.Name == Whatever then
        -- do something
    end
end