Welcome to EL&U.
I can understand why you might find the idiom as they come confusing. It is a fairly common expression in English defined by the Merriam Webster online dictionary as
—used to describe someone or something as having a characteristic to the highest degree.
so the JK Rowling is saying that goblins are intelligent to the highest degree.
In addition to the use of the idiom the second sentence has phrases missed out. I insert them here with the missing phrases in square brackets.
[They're as] clever as they come, but [they're] not the most friendly of beasts.
This means that goblins are as intelligent as any beast you might find but are not very friendly. In fact there is a suggestion that they are downright unfriendly.
The words They're as and they're are omitted partly because their existence can easily be deduced but also because expressing them would mean that the two sentences taken together would read
They're goblins, They're as clever as they come but they're not the most friendly of beasts"
This would mean that the two sentences would have they're included three times in succession which is difficult to read, wastes space, looks very clumsy and is, really, quite unnecessary.
Your problem seems to be that you have been reading a sentence with an unfamiliar idiom (as clever as they come) together with a commonly used skipping of a repeated word or words (they're). I hope this has helped.