Can you explain certain part of code given in editorial of this problem?

#include <bits/stdc++.h>
using namespace std;

string compress(string s)
{
if (s.size() == 0)
{
return “”;
}

char ch = s[0];
int i = 1;
while (i < s.size() && s[i] == ch)
{
    i++;
}

string ros = s.substr(i);
ros = compress(ros);

string charCount = to_string(i);
return ch + charCount + ros;

}

int main()
{
string s;
cin >> s;

cout << compress(s) << endl;

return 0;

}

Can you explain what is happening in these four lines of code?
string ros = s.substr(i);
ros = compress(ros);

string charCount = to_string(i);
return ch + charCount + ros;

ros is the string from i to end since we already know the answer till i, we return the known answer and call the function for rest of the string

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.