Preempting is often made with the aim of a sacrifice, where a partnership bids a contract knowing it cannot be made, but assumes that (even when doubled), the penalty will still be smaller than the value of opponents' bid and made contract.
A preemptive opening bid is an opening bid on level 2 or higher, typically made with a weak hand containing a long, strong suit. Preemptive opening bids on level 3 and higher are common for most bidding systems in the world. For example, the hand of is a typical 3 opener. The bid is made on presumption that, without any additional tricks from the partner, at least 6 tricks can be taken with hearts as trump, and the potential penalty of 500 points in 3♥ doubled is smaller than the value or opponents' likely game or slam (cca. 600 and 1400 points respectively).
As a guideline when and how high to open the bidding with a preempt, the textbooks recommend the "rule 2 and 3:
The idea is that the defeat, doubled, should cost less than the value of opponents' game:
our defeat/their game
Obviously, the preempting at unfavorable vulnerability is dangerous and thus rare; such preempts, if ever, are often made with an intention of making the contract, and the long suit is often backed up by an unusual distribution, such as 7-4-2-0.
In addition, the preempting hand should not have honors in side suits (especially not aces). That allows partner to judge the combined defensive capabilities of two hands, and to potentially bid a sacrifice contract by raising the suit, and being reasonably sure that it would not be a phantom one (i.e. that the partner won't produce an unexpected honor that turns out to be the setting trick of the opponents' game).
The same requirements generally hold for preemptive overcalls. However, they are normally loosened in third seat, when the partner has already passed, so the opening bidder can be sure that the only side preempted are the opponents, and thus can bid with better or thinner values.
Obviously, preempts in the fourth seat are very rare, as there is nobody to preempt: they do occur occasionally, though, e.g. when the player has a near-opening bid with a long suit, but is reluctant to open on level 1 for fear of being outbid by perceived opponents' major. For example, the hand might reasonably open 3 in the fourth seat, hoping to silence the opponents' with their spades and/or hearts.
In the modern bridge of aggressive style, many experts abandon the rule 2 and 3 and preempt on much slimmer values; this is a two-edged sword, as neither the partner nor the opponents can be certain about the preempter's offensive and defensive potential.
Gambling 3NT opening bid is often used to preempt with a solid minor suit.
In a more general sense, even low-level and non-jump bids can have a preemptive value if they deprive the opponents of bidding suits that they could otherwise bid on level 1 or 2. For example, weak 1 notrump (characteristic for Acol system) opening takes up entire level 1 from the opponents, who could bid their long suit on level 1 had the opening been 1 of a minor, like in Standard American bidding. However, there is always the danger that the preempting side could preempt themselves, taking up their own bidding space that could be used for constructive bidding. For example, four-card major openings have a more preemptive effect compared with five-card major openings, but also carry less precise information, as the partner should not support the opened suit without at least 4 cards; that could result in missing a partial contract or even a game.