Iot devices and alexa or samsung smart things

How are these IOT devices such as smart plugs, lights and other stuff like thermostats able to communicate and link up to samsung smart things and/or alexa? What protocol are they using? I am speaking in very general terms here so I can understand.

Perhaps a link or two to some reference material or article on how to get it done would help.

Thanks a lot.

Most IOT devices talk to Alexa and Google Home over Wifi. Alexa has a development environment provided by Amazon. You can go to:

and learn about how to develop a skill for Alexa.

Has anyone done any samples of this that can show me around? Maybe have some sample code to share?