Paste a hex color like #3498db into a browser-based converter and it returns the RGB values, in this case rgb(52, 152, 219). The conversion runs on your device by reading the three pairs of hex digits as the red, green and blue channels, and it works both ways so you can go from RGB back to hex too.
A six-digit hex color encodes three bytes: the first pair is red, the second green, the third blue, each ranging from 00 to FF, which is 0 to 255 in decimal. So #3498db splits into 34, 98 and db, which convert to 52, 152 and 219, giving rgb(52, 152, 219). A three-digit shorthand like #abc simply doubles each digit into #aabbcc.
Hex is compact and standard in design tools and CSS, while RGB and the related rgba are needed when you want to add an alpha channel for transparency or manipulate a channel in code. Converting between them is a constant small task in front-end work, and a two-way converter means you never have to do the base-16 math in your head.
rgb(52, 152, 219). The pairs 34, 98 and db convert to 52, 152 and 219.
Yes. The converter works both ways between hex and RGB.
Each digit is doubled, so #abc is the same color as #aabbcc.