If you want to share 2/3 of 4 pieces of cake you will have to find a way of dividing the pieces because 2/3 of 4 is 8/3=2 2/3. You then need to halve 2 2/3 to share with your friend, leaving you with 1 1/3 pieces. But you have a third of the 4 pieces left because you only shared 2/3 of 4 pieces. A third of 4 pieces is 4/3=1 1/3 pieces (plus what you shared with your friend, which was also 1 1/3 pieces, making 2 2/3 pieces).
Let's make the problem a lot easier. Divide each of the 4 pieces of cake into three equal parts, so you will have 12 smaller pieces of cake. Now it's much easier to divide. 2/3 of 12 small pieces is 8 small pieces. When you share 8 of these small pieces with your friend, you will have 4 small pieces each. So you have 4 small pieces by sharing and another 4 small pieces you didn't share. So you have 8 small pieces altogether.
Let's suppose your cake is round. Now imagine it's the face of a clock. If the whole cake is divided into 4 pieces then it's like cutting the cake so that one piece is the shape of the part of the clock between 12 and 3; the second piece between 3 and 6; the third piece between 6 and 9; and the fourth piece between 9 and 12. But each piece can be cut into 3. For example, the first piece would be like cutting a shape like 12 to 1, then 1 to 2, and 2 to 3. The part of the cake you will be sharing is between 12 and 8 going clockwise 12, 1, 2, 3, 4, 5, 6, 7, 8 that is two quarters (1 to 3 and 3 to 6) and 2/3 of another quarter 7 to 8, making 2 2/3). When you share with a friend, you have to divide these 8 segments so that you have 4 each. I hope you can see how this works.