For example when I see something like
WiFiClient client; so what is that doing?
That is declaring a variable, named client, that is of type WiFiClient. Bog standard C and C++ coding.
Since WiFiClient is not a standard type like int or float or char, we can surmise that it must be class or struct.
Does the h or cpp file MUST be called that, or something inside only?
There is not requirement that the name of the header file or the source file MUST match the class that it defines, but there IS a convention that says that they will. Often violated in Arduino land.
And suppose I want to see what sort of facilities are available in these programs, how do I read them.
With a text editor.
I double click and that nothing
On what operating system? On Windoze, there are default applications for a lot of types. If the type (based on the extension) is defined, the default application for that type will be started. If the type does not have a default application, Windoze will pop up a dialog telling you that, and suggesting what application might be useful. In Win10, this stupid dialog doesn't provide a way to say "never mind. I didn't mean to double click this file's icon".
then I open with textedit
A passable action. Not a great editor for code, but at least you can see the text.
there is not much documentation in the programs either.
Typically, the documentation is in the examples, not in the code. There are also some expectations that you know what a client is, what a server is, etc. So, you should not be expecting to find a "WiFiClient for Dummies" reference book in the source or header file.
I don't even understand the :: thing I see often.
Its time to take a class in object oriented programming, then.