PowerShell does not evaluate object properties inside strings. If you have an expression like this:
"$_.samAccountName"
the variable (in this case the "current object" variable $_) is expanded to the return value of its ToString() method, while the remainder of the string (.samAccountName) remains unchanged. As a result you get something like this:
"CN=Domain Users,CN=Users,DC=example,DC=com.samAccountName"
instead of the value of the group object's samAccountName property.
Using the subexpression operator $() within the string
"$($_.samAccountName)"
forces PowerShell to evaluate the object's property and put the result in the string.
Example:
PS C:\> $g = Get-ADGroup 'Domain Users'
PS C:\> $g
DistinguishedName : CN=Domain Users,CN=Users,DC=example,DC=com
GroupCategory : Security
GroupScope : Global
Name : Domain Users
ObjectClass : group
ObjectGUID : 072d9eda-a274-42ee-a4ee-b4c2810bb473
SamAccountName : Domain Users
SID : S-1-5-21-1227823062-450780232-214340840-513
PS C:\> $g.ToString()
CN=Domain Users,CN=Users,DC=example,DC=com
PS C:\> "$g"
CN=Domain Users,CN=Users,DC=example,DC=com
PS C:\> "$g.samAccountName"
CN=Domain Users,CN=Users,DC=example,DC=com.samAccountName
PS C:\> "$($g.samAccountName)"
Domain Users
However, as C.B. correctly said, in your particular case you don't need to enclose $_.samAccountName in double quotes at all. Using it like this:
$MemberCount = Get-ADGroupMember -Identity $_.samAccountName | ...
should work just fine.