5.1 means there are six audio channels. When using digital connection (optical), all these channels "travel" over the cable. With RCA (analog), only two channels are transmitted.
Your home-theater may offer "surround" modes where it can create artificial surround from stereo signal.