The rake is the house fee that is charged to the game on a per hand basis. Usually, this fee is taken directly out of the pot as the bets are collected and grouped into it, after each round of betting. The rake is usually placed on top of the "drop box" on the table, so that when the hand is complete and the pot is pushed to the winner, the dealer can drop the rake down into the secured box beneath the surface.
The rake is the only way that the house (host casino) can make money directly on Poker (of course a casino can earn indirect revenue from players through food and beverage sales, etc.); the house is not wagering on the outcome of the game so it has no vested interest in any particular result, and it does not have the "house advantage" that it typically has in other forms of gambling (e.g. Blackjack, where you bet against the house/dealer, but they have a statistical advantage).
The house will often also collect a separate "jackpot fee" to fund their jackpot prizes; that jackpot fee may or may not be considered as part of the rake by the casino (but since it is being removed from the pot, it really should be considered such by the player). Jackpot fees are often (though not always) collected separately and dropped into a separate drop box on the other side of the dealer.
The rake is not the only drain on a pot, however; players will customarily tip a small amount called a toke to the dealer after they win a pot, thus shrinking their winnings even further. A typical toke is $1 for pots between $6-80, $2 for pots above that or for special service. Toking is not required, but it is expected, in much the same way that tipping of restaurant waitresses is expected but not required.
Standard rakes are usually a small percentage of the amount in the pot, capped at a certain fixed dollar limit. A typical rake structure found at most small limit games is 5% of the pot, capped at $3. There is typically no rake taken at all for pots below a very small amount.
Since rakes in physical casinos are typically done with physical coins or chips, they are also discrete. That is, a rake is rounded up or down to the nearest coin or chip of appropriate denomination. For instance, in a 5% rake game, with a pot of $11, the rake would typically be 50 cents, since most casinos won't bother with the extra nickel, and would only deal with quarters and dollar chips.
Online casinos typically rake using percentages rounding to the nearest penny (though they may round to a nickel instead), since it's easy for them to take the extra cent or two. This presumably results in somewhat higher rake amounts than live brick and mortar casinos. However, players who sign up for online casinos through a rakeback provider can earn a rebate worth a significant percentage of the rake collected in pots they participate in (typically between 25 and 35 percent).
Because of the gambling law in California, card rooms and casinos there (except for Indian casinos) cannot rake a percentage of the pot - they must instead rake a fixed fee out of every pot regardless of its size. Because this tends to increase the rake for small limits, some Indian casinos in California have begun adopting this practice as well.
The raking structure in California has changed over the years, but the standard structure has now gravitated towards a rake of about $3-$4 for a typical hand, $1-$2 for shorthanded games, and only $1 if the hand ends before the flop is dealt. Rakes are generally $1 higher for hi-lo split games. Jackpot fees (usually $1) are usually added on top of the rake.
In many California card rooms up until about 2004, the rake was paid by the player who had the button. The player on the button placed an amount equal to the rake on the button, which was then taken by the dealer and placed on the drop box. The amount the player had placed on the button counted as a "live blind", up to a total of one small bet (any amount that the rake was over a small bet was considered forfeit to the casino). This affected play, since it meant the button was almost required to call all hands (indeed, they were usually "already in", just like the big blind was), but it did result in bigger pots for the players.
However, sometime in 2004, most card rooms in the state began switching to a more standard practice of simply taking the rake from the pot once the flop was dealt (and there was a pot to rake). There are still some holdouts (and some with even weirder rake/blind structures, like the Comstock Card Club), but most have now standardized on raking the pot for their fixed fee.
Because the rake is usually only $1 if there is no flop, it has led to a common practice in California card rooms of the small blind sacrificing the dollar from their blind if all other players have folded, but being allowed to withdraw the remainder of their blind. This is called a "chop" in common parlance (adding yet another meaning to that Poker term) and is not only considered courteous, it can sometimes save both of the blinds some money. Note that this is somewhat different than the small blind merely folding: instead of the big blind picking up the remainder of the small blind, the small blind gets to withdraw it. That's why chopping requires the approval of both blinds.
Consider the case of a 3/6 game with a $4 rake (as is typical in San Jose). If all players have folded, there is currently only $4 in the pot (the blinds). If the small blind sacrifices their blind,t he house takes $1 and the big blind gets their money back. If the small blind does not sacrifice their blind but instead merely calls, there is now $6 in the pot, and the house will take $4 of it. If the big blind folds immediately after the flop, the small blind has not made anything (they put in $2 extra and won $2 back), but the big blind has lost their whole blind. In short, no one wins except the house. This means, if the small blind doesn't feel confident in raising (in which case they can possibly win $2 of the big blind's $3), there is really no point in "just calling". Folding saves the big blind money, saves everyone's time, and gives good karma points.
In a 2/4 game with a $4 rake (as is found at Bay 101), sacrificing the small blind saves the small blind money, since if they just call, the pot will be raked down to $0 (I actually saw a hand played to the river once with $0 in the pot, and the two players began discussing who had "won") and the small blind has lost not only their blind but the additional $1.
More information about rake
Poker Rake - Wikipedia.org