What you are witnessing here are two distinct responsive design concepts that require a solid understanding of mobile design principles to grasp fully.
When setting a div with a width of 100%, it will span the full width of the screen. Similarly, a width of 50% will take up half of the screen at all times.
However, if the previously mentioned div is nested within another div with a fixed width, such as 1140px, the 100% width div will inherit the parent div's width unless the screen size is smaller. In that case, the div will adjust its width accordingly.
There are two common fixed width layout options - the reliable 960 and the more modern 1140 layouts. It's important to research CSS fixed width layouts to understand how column sizes are determined.
Click here for more information on fixed width layouts.
In addition to responsive % layouts, there are media queries which allow certain styling elements to change based on screen size. This explains why the sidebar disappears on mobile devices and reappears. Media queries alter properties like float and width in the stylesheet when the screen size changes.
If you're interested in learning more about media queries, I recommend exploring resources like the one linked above.