What is happening in these simplifications, particularly in the second step?

https://preview.redd.it/m5zfcyvv08xd1.png?width=818&format=png&auto=webp&s=04e171c7aba22a5679f279c49242ca5bc3b5fcb3

How is this technique useful? What do the commas mean? This is from a video about the book Ramanujan used to learn mathematics. I see the first step where they "take out" a number, but why do their pick those particular numbers, such as in the 4th example?