In this recipe, you created two UI Panels, each of which contains a background image of a playing card and a UI Button whose action will make its parent panel move to the front. You set the Alpha (transparency) setting of the background image's Color to 255 (no transparency).
You then added an OnClick event action to the button of each UI Panel. This action sends a SetAsLastSibling message to the button's Panel parent. When the OnClick message is received, the clicked Panel is moved to the bottom (end) of the sequence of GameObjects in Canvas, so this Panel is drawn last from the Canvas objects. This means that it appears visually in front of all the other GameObjects.
The button's action illustrates how the OnClick function does not have to be calling a public method of a scripted component of an object, but it can be sending a message to one of the non-scripted components of the targeted GameObject. In this recipe, we send the SetAsLastSibling message to the Rect Transform component of the panel where the button is located.